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, CardHeader, CardTitle } from "@/components/ui/card" import { Separator } from "@/components/ui/separator" import { getShopById, listPlayersByShop, listReviews, listServices } from "@/lib/api" import { Gamepad2, Megaphone, ShoppingBag, Star, Users } from "lucide-react" import Image from "next/image" import Link from "next/link" import { notFound } from "next/navigation" interface PageProps { params: Promise<{ id: string }> } export default async function ShopPage({ params }: PageProps) { const { id } = await params const shop = await getShopById(id) if (!shop) { notFound() } const [shopPlayers, allServices] = await Promise.all([listPlayersByShop(shop.id), listServices()]) const playerIds = shopPlayers.map((p) => p.id) const shopServices = allServices.filter((s) => playerIds.includes(s.playerId)) const shopReviews = listReviews().filter((r) => playerIds.includes(r.toUserId)) const sortedSections = [...shop.templateConfig.sections] .filter((s) => s.enabled) .sort((a, b) => a.order - b.order) return (
{shop.description}
店长:{shop.owner.nickname}
{shop.owner.bio || "暂无介绍"}
{service.description}
{service.rankRange && ({review.fromUserName}
{review.content}