'use client'; import Link from 'next/link'; import { m, useReducedMotion } from 'motion/react'; import type { PostMeta } from '@/lib/posts'; const tagToClientSlug = (tag: string): string => tag .normalize('NFKD') .toLowerCase() .replace(/[\u0300-\u036f]/g, '') .replace(/\+/g, ' plus ') .replace(/#/g, ' sharp ') .replace(/[\\/]+/g, ' ') .replace(/[^\p{L}\p{N}]+/gu, '-') .replace(/-{2,}/g, '-') .replace(/^-|-$/g, ''); export function PostCard({ slug, title, date, excerpt, tags = [], author, readingTime, index = 0, coverImage }: PostMeta & { index?: number }) { const shouldReduceMotion = useReducedMotion(); return ( {coverImage && (
{`Cover
)}
{author && ·} {author && {author}} {readingTime && ·} {readingTime && {readingTime} min read}

{title}

{excerpt && (

{excerpt}

)} {tags && tags.length > 0 && (
{tags.slice(0, 3).map((tag) => ( {tag} ))}
)}
); }