import Link from "next/link"; import { Post } from "@/types/post"; import { normalizeImageUrl } from "@/lib/normalize"; type Props = { post: Post; }; export function PostCard({ post }: Props) { const coverUrl = normalizeImageUrl(post.cover); const author = post.author || "匿名"; return (
{post.isPinned ? ( 置顶 ) : null} {post.title}

{author} |{" "} {new Date(post.createdAt).toLocaleString("zh-CN", { hour12: false, timeZone: "Asia/Shanghai" })}

{coverUrl ? ( {post.title} ) : null}
{post.tags && post.tags.length > 0 ? (
{post.tags.map((tag) => ( #{tag} ))}
) : null}
); }