feat(catalog): fetch players, services, shops

This commit is contained in:
zetaloop
2026-02-28 16:37:15 +08:00
parent f4365668ab
commit f1ae3e04bb
11 changed files with 234 additions and 57 deletions
+3 -3
View File
@@ -12,14 +12,14 @@ import {
} from "@/components/ui/card"
import { Separator } from "@/components/ui/separator"
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
import { listPlayers, listReviewsByTargetUser, listServicesByPlayer } from "@/lib/api"
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 = listPlayers().find((p) => p.id === id)
const player = await getPlayerById(id)
if (!player) {
notFound()
@@ -29,7 +29,7 @@ export default async function PlayerDetailPage({ params }: { params: Promise<{ i
const playerServices =
player.services && player.services.length > 0
? player.services
: listServicesByPlayer(player.id)
: await listServicesByPlayer(player.id)
return (
<div className="container mx-auto py-8 px-4 max-w-5xl">
<div className="flex flex-col md:flex-row gap-8 mb-8">