From e4a65314bd39ac85942edbe0eed6faa42675621b Mon Sep 17 00:00:00 2001 From: Jean-Luc Makiola Date: Fri, 10 Apr 2026 11:05:52 +0200 Subject: [PATCH] feat(25-02): add attribution display on catalog detail page - GlobalItem interface extended with sourceUrl, imageCredit, imageSourceUrl fields - Attribution block below image: Photo credit and source link when present - Product page link (sourceUrl) at bottom of detail page - Image div mb-6 moved to attribution paragraph for consistent spacing --- src/client/hooks/useGlobalItems.ts | 3 ++ .../routes/global-items/$globalItemId.tsx | 35 ++++++++++++++++++- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/client/hooks/useGlobalItems.ts b/src/client/hooks/useGlobalItems.ts index da0c4fc..ecfff5b 100644 --- a/src/client/hooks/useGlobalItems.ts +++ b/src/client/hooks/useGlobalItems.ts @@ -10,6 +10,9 @@ interface GlobalItem { priceCents: number | null; imageUrl: string | null; description: string | null; + sourceUrl: string | null; + imageCredit: string | null; + imageSourceUrl: string | null; createdAt: string; } diff --git a/src/client/routes/global-items/$globalItemId.tsx b/src/client/routes/global-items/$globalItemId.tsx index 80b2af7..e4533fb 100644 --- a/src/client/routes/global-items/$globalItemId.tsx +++ b/src/client/routes/global-items/$globalItemId.tsx @@ -62,7 +62,7 @@ function GlobalItemDetail() { {/* Image */} -
+
{item.imageUrl ? ( + {/* Attribution */} + {(item.imageCredit || item.imageSourceUrl) && ( +

+ {item.imageCredit && Photo: {item.imageCredit}} + {item.imageCredit && item.imageSourceUrl && ยท } + {item.imageSourceUrl && ( + + Source + + )} +

+ )} + {!(item.imageCredit || item.imageSourceUrl) &&
} + {/* Header */}

@@ -169,6 +188,20 @@ function GlobalItemDetail() {

{item.description}

)} + + {/* Product page link */} + {item.sourceUrl && ( +
+ + View product page → + +
+ )}
); }