import Image from 'next/image'; import { getToyById, getAllToys } from '@/data/operations'; import type { Toy } from '@/types'; import { Button } from '@/components/ui/button'; import { ArrowLeft, DollarSign, MapPin, ShoppingBag, UserCircle2 } from 'lucide-react'; import Link from 'next/link'; import { Badge } from '@/components/ui/badge'; import { Separator } from '@/components/ui/separator'; import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'; interface ToyPageProps { params: { id: string }; } export default async function ToyPage({ params }: ToyPageProps) { const toy = getToyById(params.id); if (!toy) { return (
Sorry, the toy you are looking for does not exist or has been removed.
{toy.description}