From ac06a21307d120ba7ac5318f1b1e54380a41fbce Mon Sep 17 00:00:00 2001 From: Miqdad Date: Fri, 17 Oct 2025 19:15:03 +0700 Subject: cr renca baru desktop --- src/lib/product/components/ProductCard.jsx | 194 ++++++++++------------------- 1 file changed, 64 insertions(+), 130 deletions(-) diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx index 4c1e4a14..ac1ab29b 100644 --- a/src/lib/product/components/ProductCard.jsx +++ b/src/lib/product/components/ProductCard.jsx @@ -86,27 +86,31 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { aria-label='Produk' >
- {/* New Image */} -
- {product?.name} -
- {/* Old Image */} - - {/* {product?.name} */} -
+ /> + + {/* PICK UP NOW badge (kanan-atas gambar) */} + {product?.isInBu && ( + + Pick Up Now + + )} + +
{product?.isSni && ( {
+ {/* BADGE DISKON KIRI-ATAS (match mobile) */} + {(product?.lowestPrice?.discountPercentage ?? 0) > 0 && ( +
+
+ {Math.floor(product.lowestPrice.discountPercentage)}% +
+
+ )} + {router.pathname != '/' && product?.flashSale?.id > 0 && (
@@ -146,7 +159,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { />
-
+ {/*
{Math.floor(product?.lowestPrice.discountPercentage)}% @@ -167,7 +180,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { : 'FLASH SALE'}
-
+
*/}
)} @@ -177,6 +190,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
)} +
{product?.manufacture?.name ? ( @@ -190,23 +204,9 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { ) : (
-
)} - {product?.isInBu && ( - - pickup now - - )}
+ + {/* ⬇️ line clamp desktop dibiarkan seperti aslinya */} { {product?.name} - {/* New Price Section */} {product?.flashSale?.id > 0 && - product?.lowestPrice.discountPercentage > 0 ? ( -
-
- {/* harga sekarang (merah) */} - - {product?.lowestPrice.priceDiscount > 0 ? ( - currencyFormat(product?.lowestPrice.price) - ) : ( - - Call for Inquiry - - )} - - - {/* harga lama (abu, dicoret) */} - - {currencyFormat(product.lowestPrice.price)} - -
-
- ) : ( -
- {product?.lowestPrice.price > 0 ? ( - <> - {currencyFormat(product?.lowestPrice.priceDiscount)} -
- Include PPN:{' '} - {currencyFormat( - product.lowestPrice.price * - process.env.NEXT_PUBLIC_PPN - )} -
- - ) : ( - - Call for Inquiry - - )} -
- )} - - {/* Old Price section */} - {/* {product?.flashSale?.id > 0 && product?.lowestPrice.discountPercentage > 0 ? ( <>
{currencyFormat(product.lowestPrice.price)}
-
- {Math.floor(product?.lowestPrice.discountPercentage)}% -
{product?.lowestPrice.priceDiscount > 0 ? ( @@ -326,8 +269,8 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { )}
- )} */} - {/* New voucher section */} + )} + {discount > 0 && (product?.flashSale?.id ?? 0) < 1 && (
@@ -341,20 +284,11 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
)} - {/* Old */} - {/* {discount > 0 && product?.flashSale?.id < 1 && ( -
-
- Voucher : {currencyFormat(discount)} -
-
- )} */}
{product?.stockTotal > 0 && (
Ready Stock
)} - {/*
{product?.stockTotal > 5 ? '> 5' : '< 5'}
*/} {product?.qtySold > 0 && (
{sellingProductFormat(product?.qtySold) + ' Terjual'} @@ -517,37 +451,37 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { {product?.flashSale?.id > 0 && product?.lowestPrice.discountPercentage > 0 ? ( -
-
- {/* harga sekarang (merah) */} - - {product?.lowestPrice.priceDiscount > 0 ? ( - currencyFormat(product?.lowestPrice.price) - ) : ( - - Call for Inquiry - - )} - - - {/* harga lama (abu, dicoret) */} - + <> +
+
{currencyFormat(product.lowestPrice.price)} - +
+ {/*
+ {Math.floor(product?.lowestPrice.discountPercentage)}% +
*/}
-
+
+ {product?.lowestPrice.priceDiscount > 0 ? ( + currencyFormat(product?.lowestPrice.priceDiscount) + ) : ( + + Call for Inquiry + + )} +
+ ) : ( -
+
{product?.lowestPrice.price > 0 ? ( <> - {currencyFormat(product?.lowestPrice.priceDiscount)} -
- Include PPN:{' '} + {currencyFormat(product?.lowestPrice.price)} +
+ Inc. PPN:{' '} {currencyFormat( product.lowestPrice.price * process.env.NEXT_PUBLIC_PPN -- cgit v1.2.3