import { cn } from "@/lib/utils"; import Link from "next/link"; import Image from "next/image"; import { urlFor } from "@/sanity/lib/image"; import { ChevronRight } from "lucide-react"; import { Badge } from "@/components/ui/badge"; import { PAGE_QUERY_RESULT, ColorVariant } from "@/sanity.types"; type Block = NonNullable["blocks"]>[number]; type GridRow = Extract; type GridColumn = NonNullable>[number]; type GridPost = Extract; interface GridPostProps extends Omit, "_type" | "_key"> { color?: ColorVariant; } export default function GridPost({ color, post }: GridPostProps) { if (!post) return null; const { title, slug, excerpt, image, categories } = post; return (
{image && image.asset?._id && (
{image.alt
)} {title && (

{title}

)} {categories && categories.length > 0 && (
{categories.map((category) => ( {category.title} ))}
)} {excerpt &&

{excerpt}

}
); }