From d336735a91133cc3f1cf6f67ba2ac29f0985fd2e Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Thu, 2 Mar 2023 16:51:05 +0700 Subject: delete src2 --- src2/components/variants/VariantCard.js | 92 --------------------------------- 1 file changed, 92 deletions(-) delete mode 100644 src2/components/variants/VariantCard.js (limited to 'src2/components/variants/VariantCard.js') diff --git a/src2/components/variants/VariantCard.js b/src2/components/variants/VariantCard.js deleted file mode 100644 index a821480c..00000000 --- a/src2/components/variants/VariantCard.js +++ /dev/null @@ -1,92 +0,0 @@ -import { createSlug } from "@/core/utils/slug"; -import Image from "../elements/Image"; -import Link from "../elements/Link"; -import currencyFormat from "@/core/utils/currencyFormat"; -import { useRouter } from "next/router"; -import { toast } from "react-hot-toast"; -import { createOrUpdateItemCart } from "@/core/utils/cart"; - -export default function VariantCard({ - data, - openOnClick = true, - buyMore = false -}) { - let product = data; - const router = useRouter(); - - const addItemToCart = () => { - toast.success('Berhasil menambahkan ke keranjang', { duration: 1500 }); - createOrUpdateItemCart(product.id, 1); - return; - }; - - const checkoutItem = () => { - router.push(`/shop/checkout?product_id=${product.id}&qty=${product.quantity}`); - } - - const Card = () => ( -
-
- {product.parent.name} -
-
-

- {product.parent.name} -

-

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

-
- {product.price.discount_percentage > 0 && ( - <> -

{currencyFormat(product.price.price)}

- {product.price.discount_percentage}% - - )} -

{currencyFormat(product.price.price_discount)}

-
-

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

-

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

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