import { ImageWrapper } from '@/components/content/ImageWrapper' import { PostMeta } from '@/types/Post.type' import Link from 'next/link' import { dateFormatter } from '@/utils/time' import { cn } from '@/utils/cn' type PostProps = { post: PostMeta isLatest?: boolean showImageSlot?: boolean } export function Post({ post, isLatest, showImageSlot }: PostProps) { const { title, description, author, category, date, coverImage, coverImageAlt, readingTimeText, slug, } = post if (!title || !description || !author || !date) { return null } const publishedAt = new Date(date) return (
{(isLatest || showImageSlot) && (
{coverImage && }
)}
{isLatest && Latest post} {category && (
{category}
)}

{title}

{description}

· {readingTimeText}
) }