'use client'; import { motion } from "framer-motion"; import Link from "next/link"; import type { SanityDocument } from "next-sanity"; interface BlogPost extends SanityDocument { title: string; slug: string; publishedAt: string; excerpt?: string; mainImage?: { image: { asset: { _id: string; url: string; metadata: { dimensions: { width: number; height: number; }; }; }; }; }; } interface AnimatedBlogCardProps { post: BlogPost; postImageUrl: string | null; index: number; } export function AnimatedBlogCard({ post, postImageUrl, index }: AnimatedBlogCardProps) { return ( {postImageUrl && (
{post.title}
)}
{post.categories?.map((category: string) => ( {category} ))}

{post.title}

{post.excerpt && (

{post.excerpt}

)}
{new Date(post.publishedAt).toLocaleDateString("en-US", { year: "numeric", month: "long", day: "numeric", })}
); }