import { FavoriteButton } from "@/components/favorite-button" import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, } from "@/components/ui/card" import { Separator } from "@/components/ui/separator" import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" import { getPlayerById, listReviewsByTargetUser, listServicesByPlayer } from "@/lib/api" import { CheckCircle, Clock, MapPin, MessageSquare, ShoppingBag, Star } from "lucide-react" import Link from "next/link" import { notFound } from "next/navigation" export default async function PlayerDetailPage({ params }: { params: Promise<{ id: string }> }) { const { id } = await params const player = await getPlayerById(id) if (!player) { notFound() } const playerReviews = listReviewsByTargetUser(player.id) const playerServices = player.services && player.services.length > 0 ? player.services : await listServicesByPlayer(player.id) return (
{player.user.nickname[0]}

{player.user.nickname} {player.status === "available" ? "可接单" : "忙碌中"}

{player.rating}
接单 {player.totalOrders} 完成率 {(player.completionRate * 100).toFixed(0)}%
{player.shopId && ( )}

{player.user.bio || "这个打手很懒,什么都没写~"}

{player.tags.map((tag) => ( {tag} ))}
服务列表 ({playerServices.length}) 评价 ({playerReviews.length})
{playerServices.map((service) => (
{service.gameName}
¥{service.price}{" "} / {service.unit}
{service.title} {service.description}
{service.rankRange && (
段位: {service.rankRange}
)}
{service.availability.map((time) => ( {time} ))}
))} {playerServices.length === 0 && (

暂无服务

)}
{playerReviews.length > 0 ? ( playerReviews.map((review) => (
{review.fromUserName[0]}
{review.fromUserName}
{new Date(review.createdAt).toLocaleDateString()}
{[1, 2, 3, 4, 5].map((star) => ( ))}

{review.content}

{review.sealed && (
平台认证评价
)}
)) ) : (

暂无评价

)}
) }