feat: favorites — type, mock data, and buttons on player/shop detail pages
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { CheckCircle, Clock, MapPin, MessageSquare, ShoppingBag, Star } from "lucide-react"
|
||||
import Link from "next/link"
|
||||
import { notFound } from "next/navigation"
|
||||
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"
|
||||
@@ -14,7 +15,7 @@ import {
|
||||
} from "@/components/ui/card"
|
||||
import { Separator } from "@/components/ui/separator"
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
|
||||
import { mockPlayers, mockReviews, mockServices } from "@/lib/mock-data"
|
||||
import { mockFavorites, mockPlayers, mockReviews, mockServices } from "@/lib/mock-data"
|
||||
|
||||
export default async function PlayerDetailPage({ params }: { params: Promise<{ id: string }> }) {
|
||||
const { id } = await params
|
||||
@@ -29,6 +30,9 @@ export default async function PlayerDetailPage({ params }: { params: Promise<{ i
|
||||
player.services && player.services.length > 0
|
||||
? player.services
|
||||
: mockServices.filter((s) => s.playerId === player.id)
|
||||
const isFavorited = mockFavorites.some(
|
||||
(f) => f.userId === "u1" && f.targetType === "player" && f.targetId === player.id,
|
||||
)
|
||||
|
||||
return (
|
||||
<div className="container mx-auto py-8 px-4 max-w-5xl">
|
||||
@@ -72,6 +76,7 @@ export default async function PlayerDetailPage({ params }: { params: Promise<{ i
|
||||
</Button>
|
||||
</Link>
|
||||
)}
|
||||
<FavoriteButton initialFavorited={isFavorited} />
|
||||
</div>
|
||||
|
||||
<div className="bg-muted/50 p-4 rounded-lg">
|
||||
|
||||
Reference in New Issue
Block a user