feat(catalog): fetch players, services, shops
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user