From 731d677da6d775716d8e07668d81a007033dc56e Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Mon, 13 Apr 2026 20:10:02 +0200 Subject: [PATCH] fix: shared setup items link to catalog instead of requiring auth Items with a globalItemId now link to /global-items/:id (public) in shared and public setup views. Items without a catalog link are not clickable. Owner view behavior unchanged. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/client/components/ItemCard.tsx | 19 +++++++++++++++---- src/client/routes/setups/$setupId.tsx | 7 +++++++ 2 files changed, 22 insertions(+), 4 deletions(-) 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 (