import Image from 'next/image'; import Link from 'next/link'; import type { Toy } from '@/types'; import { Card, CardContent, CardFooter, CardHeader, CardTitle } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; import { DollarSign, MapPin, Tag } from 'lucide-react'; interface ToyCardProps { toy: Toy & { dataAiHint?: string }; // dataAiHint is for placeholder, not part of core Toy type } export default function ToyCard({ toy }: ToyCardProps) { const primaryImage = toy.images && toy.images.length > 0 ? toy.images[0] : 'https://placehold.co/300x200.png'; const placeholderHint = toy.dataAiHint || toy.category.toLowerCase() || "toy"; return (
{toy.name}
{toy.name}
{toy.category}
{toy.location && (
{toy.location}
)} {toy.pricePerDay !== undefined && (
{toy.pricePerDay > 0 ? `${toy.pricePerDay}/day` : 'Free'}
)}
); }