import Link from "next/link"; import { ArrowLeft } from "lucide-react"; import type { PostListItem } from "@/lib/api"; import { formatRelative } from "@/lib/format"; import { normalizePostType, postTypeLabel, contentAccessLabel, typeStatusLabel } from "@/lib/postMeta"; import LikeButton from "./LikeButton"; import Avatar from "./Avatar"; import { IconComment, IconEye } from "./Icons"; /** * 帖子列表行(参考社区信息流样式): * 大头像 + 加粗标题(徽章内联)+ 第二行「板块 · 作者 · 发布时间 ← 最后回复」+ * 右侧评论数等统计垂直居中。用于首页/板块页/搜索结果。 */ export default function PostRow({ post, boardHref, index = 0, compact = false, showViews = true, showLike = true, }: { post: PostListItem; index?: number; boardHref?: boolean; compact?: boolean; showViews?: boolean; showLike?: boolean; }) { const lastReply = post.last_reply; const replied = lastReply && new Date(lastReply.created_at).getTime() > new Date(post.created_at).getTime() + 60_000; const pt = normalizePostType(post.post_type); const statusBadge = pt !== "discussion" ? typeStatusLabel(pt, post.type_status) : ""; return (