import { ArrowLeft, MessageCircle, Pin, Star } from "lucide-react" import Image from "next/image" import Link from "next/link" import { notFound } from "next/navigation" 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 { getOrderById, getPlayerById, getPostById, listCommentsByPost } from "@/lib/api" import { roleLabels } from "@/lib/constants" export default async function PostDetailPage({ params }: { params: Promise<{ id: string }> }) { const { id } = await params const post = getPostById(id) if (!post) notFound() const comments = listCommentsByPost(id) const linkedOrder = post.linkedOrderId ? getOrderById(post.linkedOrderId) : null const linkedPlayer = linkedOrder ? getPlayerById(linkedOrder.playerId) : null 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) => (
帖子图片
))}
)} {linkedOrder && (
关联订单

{linkedOrder.service.gameName} · {linkedOrder.service.title} · 评分{" "} {linkedPlayer?.rating ?? "--"}

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