import Link from 'next/link'; import { formatDate } from '@/lib/utils'; export type PostCardPost = { slug: string; title: string; excerpt: string; publishedAt: Date | null; readingMinutes: number; tags: { tag: { name: string; slug: string } }[]; author: { name: string; slug: string }; }; export function PostCard({ post }: { post: PostCardPost }) { return (
{post.tags.length > 0 && (
{post.tags.map(({ tag }) => ( {tag.name} ))}
)}

{post.title}

{post.excerpt}

{post.publishedAt ? formatDate(post.publishedAt) : 'Draft'} · {post.readingMinutes} min read ·{' '} {post.author.name}

); }