import Link from 'next/link'; import Image from 'next/image'; import type { Post } from 'contentlayer2/generated'; import { siteConfig } from '@/lib/config'; import { FiCalendar, FiTag } from 'react-icons/fi'; import { MetaItem } from './meta-item'; interface PostCardProps { post: Post; showTags?: boolean; } export function PostCard({ post, showTags = true }: PostCardProps) { const cover = post.feature_image && post.feature_image.startsWith('../assets') ? post.feature_image.replace('../assets', '/assets') : undefined; return (
{cover && (
{post.title}
)}
{post.published_at && ( {new Date(post.published_at).toLocaleDateString( siteConfig.defaultLocale )} )} {showTags && post.tags && post.tags.length > 0 && ( {post.tags.slice(0, 3).join(', ')} )}

{post.title}

{post.description && (

{post.description}

)}
); }