import Link from 'next/link'; import type { Post } from 'contentlayer/generated'; import { siteConfig } from '@/lib/config'; import { faCalendarDays, faTags } from '@fortawesome/free-solid-svg-icons'; import { MetaItem } from './meta-item'; interface Props { post: Post; } export function PostListItem({ post }: Props) { const cover = post.feature_image && post.feature_image.startsWith('../assets') ? post.feature_image.replace('../assets', '/assets') : undefined; const excerpt = post.description || post.custom_excerpt || post.body?.raw?.slice(0, 120); return (
  • {cover && (
    {/* eslint-disable-next-line @next/next/no-img-element */} {post.title}
    )}
    {post.published_at && ( {new Date(post.published_at).toLocaleDateString( siteConfig.defaultLocale )} )} {post.tags && post.tags.length > 0 && ( {post.tags.slice(0, 3).join(', ')} )}

    {post.title}

    {excerpt && (

    {excerpt}

    )}
  • ); }