import Link from 'next/link'; import { Check, Gift, ImageOff } from 'lucide-react'; import { cn } from 'cn'; import type { CatalogRow } from '@/lib/queries/catalog'; import { formatEuro } from '@/lib/money'; import { setImageSrc } from '@/lib/images'; import { Badge } from '@/components/ui/badge'; /** * One set in the catalog grid. * * Rendered as a plain block so it can be used both as a link (browsing) and * inside a selection wrapper (bulk add to a wishlist). */ export function SetCardContent({ set }: { set: CatalogRow }) { const image = setImageSrc(set); const owned = set.ownedCopies > 0; return (
{image ? ( // Plain img: images are either local files or a URL the user entered, // and the optimizer must never fetch arbitrary remote hosts. // eslint-disable-next-line @next/next/no-img-element ) : (
)}
{owned ? ( {set.ownedCopies > 1 ? `${set.ownedCopies}× vorhanden` : 'Vorhanden'} ) : null} {set.wishlistCount > 0 ? ( Auf Wunschliste ) : null}
{set.setNumber} {set.manufacturerName}

{set.name}

{[set.themeName, set.year].filter(Boolean).join(' · ')} {set.retailPriceCents !== null ? ( {formatEuro(set.retailPriceCents)} ) : null}
); } export function SetCard({ set, className }: { set: CatalogRow; className?: string }) { return ( div]:hover:border-primary/40', className, )} > ); }