import Link from "next/link"; import type { PostListItem } from "@/lib/api"; import LikeButton from "./LikeButton"; import Avatar from "./Avatar"; import { IconComment, IconEye } from "./Icons"; function formatTime(dateStr: string) { return new Date(dateStr).toLocaleDateString("zh-CN"); } /** * 首页精选主卡:取自非置顶帖中的最新一帖(置顶帖由 PinnedPosts 承载) */ export default function FeaturePost({ post }: { post: PostListItem }) { return (
{/* 柔和装饰块,非发光 */}
今日精选 {post.recommended && 推荐} {post.board.name}

{post.title}

{post.tags && (
{[ ...new Set( post.tags .split(",") .map((t) => t.trim()) .filter(Boolean) ), ] .slice(0, 4) .map((t, i) => ( # {t} ))}
)}
{post.user.nickname} {formatTime(post.created_at)} {post.comment_count} {post.view_count}
); }