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 f55d3aa..ed57109 100644 --- a/src/client/dd-hub-react/src/api/product-service.ts +++ b/src/client/dd-hub-react/src/api/product-service.ts @@ -1,11 +1,12 @@ export type Product = { - id: string; - name: string; - price?: number; - status: string; - coverUrl: string; - colors?: string[]; - priceSale?: number; + id: string; + name: string; + price?: number; + status?: string; + version?: string; + coverUrl?: string; + colors?: string[]; + priceSale?: number; }; /** @@ -18,14 +19,12 @@ export function getProducts(): Promise { { id: '1', name: "User Manager", - coverUrl: "/assets/images/product/product-default.webp", - status: "1.0.0" + version: "1.0.0" }, { id: '2', name: "Envelope Generator", - coverUrl: "/assets/images/product/product-default.webp", - status: "1.0.0" + version: "1.0.0" } ]); } \ No newline at end of file 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 492d724..7225ad6 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 @@ -33,7 +33,23 @@ export function ProductItem({ product }: { product: Product }) { ); - const [imgSrc, setImgSrc] = useState(product.coverUrl); + const renderVersion = ( + + ); + + const [imgSrc, setImgSrc] = useState(product.coverUrl ?? "/assets/images/product/product-default.webp"); const renderImg = ( {product.status && renderStatus} + {product.version && renderVersion} {renderImg}