From ada2e1cb72d221fa719378f35aa1672d356e20e5 Mon Sep 17 00:00:00 2001 From: TekH Date: Thu, 3 Jul 2025 09:14:49 +0200 Subject: [PATCH] Add optional URL to Product type and update Link component Updated the `Product` type in `product-service.ts` to include an optional `url` property. Modified the `Link` component in `product-item.tsx` to use this new `url` for navigation, defaulting to '/404' if not provided. This enhances product item display by making product names clickable. --- src/client/dd-hub-react/src/api/product-service.ts | 1 + src/client/dd-hub-react/src/sections/product/product-item.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client/dd-hub-react/src/api/product-service.ts b/src/client/dd-hub-react/src/api/product-service.ts index 8bc2934..36d5c58 100644 --- a/src/client/dd-hub-react/src/api/product-service.ts +++ b/src/client/dd-hub-react/src/api/product-service.ts @@ -7,6 +7,7 @@ export type Product = { coverUrl?: string; colors?: string[]; priceSale?: number; + url?: string; }; /** diff --git a/src/client/dd-hub-react/src/sections/product/product-item.tsx b/src/client/dd-hub-react/src/sections/product/product-item.tsx index 7225ad6..2415e0a 100644 --- a/src/client/dd-hub-react/src/sections/product/product-item.tsx +++ b/src/client/dd-hub-react/src/sections/product/product-item.tsx @@ -93,7 +93,7 @@ export function ProductItem({ product }: { product: Product }) { - + {product.name}