import { PostCommentCount } from "@/components/post-comment-count" import { PostComments } from "@/components/post-comments" import { PostLikeButton } from "@/components/post-like-button" import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { Badge } from "@/components/ui/badge" import { Card, CardContent, CardHeader } from "@/components/ui/card" import { Separator } from "@/components/ui/separator" import { getPostById } from "@/lib/api" import { roleLabels } from "@/lib/constants" import { ArrowLeft, Pin, Star } from "lucide-react" import Image from "next/image" import Link from "next/link" import { notFound } from "next/navigation" export default async function PostDetailPage({ params }: { params: Promise<{ id: string }> }) { const { id } = await params const post = await getPostById(id) if (!post) notFound() return (
返回社区
{post.author.nickname[0]}
{post.author.nickname} {roleLabels[post.authorRole]} {post.pinned && }
{new Date(post.createdAt).toLocaleString("zh-CN")}

{post.title}

{post.content}

{post.images.length > 0 && (
{post.images.map((img) => (
帖子图片
))}
)} {post.linkedOrderId && (
关联订单

点击查看订单详情

)} {post.tags.length > 0 && (
{post.tags.map((tag) => ( {tag} ))}
)}
) }