import Link from 'next/link' import Image from 'next/image' import { Post } from '@/lib/types/frontmatter' import { formatDate } from '@/lib/utils' interface BlogCardProps { post: Post variant: 'image-top' | 'image-side' | 'text-only' } export function BlogCard({ post, variant }: BlogCardProps) { const hasImage = !!post.frontmatter.image if (!hasImage || variant === 'text-only') { return (
{post.frontmatter.category} // {formatDate(post.frontmatter.date)}

{post.frontmatter.title}

{post.frontmatter.description}

{post.frontmatter.tags.map((tag) => ( #{tag} ))}
> READ [{post.readingTime}MIN]
) } if (variant === 'image-side') { return (
{post.frontmatter.title}
{post.frontmatter.category} // {formatDate(post.frontmatter.date)}

{post.frontmatter.title}

{post.frontmatter.description}

{post.frontmatter.tags.map((tag) => ( #{tag} ))}
> READ [{post.readingTime}MIN]
) } return (
{post.frontmatter.title}
{post.frontmatter.category} // {formatDate(post.frontmatter.date)}

{post.frontmatter.title}

{post.frontmatter.description}

{post.frontmatter.tags.map((tag) => ( #{tag} ))}
> READ [{post.readingTime}MIN]
) }