From ebc09c5062cc7996b0f2aaf879062fc950c2e1c2 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Wed, 25 Jan 2023 11:17:37 +0700 Subject: Transaction detail and variant card component --- src/components/variants/VariantCard.js | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/components/variants/VariantCard.js (limited to 'src/components/variants/VariantCard.js') diff --git a/src/components/variants/VariantCard.js b/src/components/variants/VariantCard.js new file mode 100644 index 00000000..cb4d8272 --- /dev/null +++ b/src/components/variants/VariantCard.js @@ -0,0 +1,48 @@ +import { createSlug } from "@/core/utils/slug"; +import Image from "../elements/Image"; +import Link from "../elements/Link"; +import currencyFormat from "@/core/utils/currencyFormat"; + +export default function VariantCard({ + data, + openOnClick = true +}) { + let product = data; + + const Card = () => ( +
+
+ {product.parent.name} +
+
+

+ {product.parent.name} +

+

+ {product.code || '-'} + {product.attributes.length > 0 ? ` ・ ${product.attributes.join(', ')}` : ''} +

+

+ {currencyFormat(product.price.price_discount)} × {product.quantity} Barang +

+

+ {currencyFormat(product.quantity * product.price.price_discount)} +

+
+
+ ); + + if (openOnClick) { + return ( + + + + ); + } + + return ; +} \ No newline at end of file -- cgit v1.2.3