import { Badge } from '@/components/ui/badge'; import type { PostItem } from '../api/types'; import { formatTime } from '../utils/content'; interface Props { post: PostItem; onClick: () => void; } export default function PostListItem({ post, onClick }: Props) { const initial = post.user?.nickname?.[0] || '?'; return (
{post.user?.avatar ? : initial}
{post.pinned && 置顶} {post.title}
{post.board && {post.board.name}} {post.user?.nickname || '匿名'} {formatTime(post.created_at)}
💬 {post.comment_count ?? 0} 👍 {post.like_count ?? 0}
); }