import { Gem, cn } from "@rubis/ui"; import type { PostSummary } from "../../lib/api"; const DATE_FMT = new Intl.DateTimeFormat("fr-FR", { year: "numeric", month: "long", day: "numeric", }); export function PostCard({ post, className, }: { post: PostSummary; className?: string; }) { const dateLabel = post.publishedAt ? DATE_FMT.format(new Date(post.publishedAt)) : null; return (
{post.heroImageUrl ? ( {post.heroImageAlt ) : ( )}
{dateLabel && ( )} {dateLabel && } {post.readingTimeMinutes} min de lecture

{post.title}

{post.excerpt}

Lire l'article
); }