diff --git a/src/client/components/ItemCard.tsx b/src/client/components/ItemCard.tsx index ef7a19f..abbca67 100644 --- a/src/client/components/ItemCard.tsx +++ b/src/client/components/ItemCard.tsx @@ -25,6 +25,7 @@ interface ItemCardProps { onRemove?: () => void; classification?: string; onClassificationCycle?: () => void; + linkTo?: string | null; } export function ItemCard({ @@ -46,19 +47,29 @@ export function ItemCard({ onRemove, classification, onClassificationCycle, + linkTo, }: ItemCardProps) { const { weight, price } = useFormatters(); const navigate = useNavigate(); const openExternalLink = useUIStore((s) => s.openExternalLink); const duplicateItem = useDuplicateItem(); + const handleClick = + linkTo === null + ? undefined + : () => { + if (linkTo) { + navigate({ to: linkTo }); + } else { + navigate({ to: "/items/$itemId", params: { itemId: String(id) } }); + } + }; + return (