From 260a6ab254a61f76d8975b21d2c8f31c4ca1269f Mon Sep 17 00:00:00 2001 From: root Date: Tue, 1 Nov 2022 10:46:51 +0700 Subject: Update filename --- src/components/ProductCard.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/components/ProductCard.js (limited to 'src/components/ProductCard.js') diff --git a/src/components/ProductCard.js b/src/components/ProductCard.js new file mode 100644 index 00000000..f51473ad --- /dev/null +++ b/src/components/ProductCard.js @@ -0,0 +1,39 @@ +import Link from "next/link"; +import currencyFormat from "../helpers/currencyFormat"; +import { createSlug } from "../helpers/slug"; +import { LazyLoadImage } from "react-lazy-load-image-component"; + +import 'react-lazy-load-image-component/src/effects/blur.css'; + + +export default function productCard({ data }) { + let product = data; + return ( +
+ + + +
+
+ {typeof product.manufacture.name !== undefined ? ( + {product.manufacture.name} + ) : ( + - + )} + + {product.name} + +
+
+ {product.lowest_price.discount_percentage > 0 ? ( +
+ {product.lowest_price.discount_percentage}% +

{currencyFormat(product.lowest_price.price)}

+
+ ) : ''} +

{product.lowest_price.price_discount > 0 ? currencyFormat(product.lowest_price.price_discount) : 'Tanya harga'}

+
+
+
+ ) +} \ No newline at end of file -- cgit v1.2.3