import Link from 'next/link'; import type { Post } from 'contentlayer/generated'; import { siteConfig } from '@/lib/config'; 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; 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.title}

    {post.tags && post.tags.length > 0 && (
    {post.tags.slice(0, 4).map((t) => ( #{t} ))}
    )} {post.description && (

    {post.description}

    )}
  • ); }