'use client'; import Image from 'next/image'; import Link from 'next/link'; import { useState } from 'react'; import type { PlazaPost } from '@/types/plaza'; import { categoryAccent, formatCount, formatRelativeTime } from '@/lib/format'; import { plazaPath } from '@/lib/site'; export function PostCard({ post, priority = false }: { post: PlazaPost; priority?: boolean }) { const [coverFailed, setCoverFailed] = useState(false); const showFallback = !post.cover_url || coverFailed; const accent = categoryAccent(post.category.slug); const initial = post.title.trim().charAt(0) || '้กต'; return (
{post.summary}
) : null}