import { Link } from 'react-router-dom'; import { Badge } from '@/components/ui/Badge'; import { MachineThumbnail } from '@/components/catalogue/MachineThumbnail'; import { appConfig } from '@/config/appConfig'; import type { CatalogueViewMode, MachineRegistryItem } from '@/types/catalogue'; import { cn } from '@/utils/classNames'; import { categoryShortLabel, difficultyToTone, partCountLabel, phaseLabel } from '@/utils/format'; export interface MachineCardProps { readonly machine: MachineRegistryItem; readonly isFavourite: boolean; readonly onToggleFavourite: (slug: string) => void; readonly viewMode?: CatalogueViewMode; } function BookmarkIcon({ filled }: { readonly filled: boolean }) { return ( ); } export function MachineCard({ isFavourite, machine, onToggleFavourite, viewMode = 'comfortable' }: MachineCardProps) { const compact = viewMode === 'compact'; const visibleTags = machine.tags.slice(0, appConfig.catalogue.maxVisibleCardTags); return (
{categoryShortLabel(machine.category)} {machine.difficulty} {phaseLabel(machine.releasePhase)}

{machine.title}

{machine.subtitle}

{machine.shortDescription}

Parts
{machine.estimatedPartCount}
Complexity
{machine.complexity}/5
Facts
{machine.facts.length}
{visibleTags.map((tag) => ( {tag} ))}
{partCountLabel(machine.parts.length)} annotated Inspect →
); }