summaryrefslogtreecommitdiff
path: root/src/lib/product/components/ProductCard.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/product/components/ProductCard.jsx')
-rw-r--r--src/lib/product/components/ProductCard.jsx39
1 files changed, 17 insertions, 22 deletions
diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx
index 3b96ac32..9500a3fd 100644
--- a/src/lib/product/components/ProductCard.jsx
+++ b/src/lib/product/components/ProductCard.jsx
@@ -1,6 +1,7 @@
import Image from '@/core/components/elements/Image/Image'
import Link from '@/core/components/elements/Link/Link'
import currencyFormat from '@/core/utils/currencyFormat'
+import { sellingProductFormat } from '@/core/utils/formatValue'
import { createSlug } from '@/core/utils/slug'
import whatsappUrl from '@/core/utils/whatsappUrl'
import ImageNext from 'next/image'
@@ -82,9 +83,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
)}
<Link
href={createSlug('/shop/product/', product?.name, product?.id)}
- className={`mb-3 !text-gray_r-12 leading-6 block ${
- simpleTitle ? 'line-clamp-2 h-12' : 'line-clamp-3 h-[64px]'
- }`}
+ className={`mb-2 !text-gray_r-12 leading-6 block line-clamp-3 h-[64px]`}
title={product?.name}
>
{product?.name}
@@ -103,7 +102,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
{product?.lowestPrice.priceDiscount > 0 ? (
currencyFormat(product?.lowestPrice.priceDiscount)
) : (
- <a href={callForPriceWhatsapp}>Call for price</a>
+ <a href={callForPriceWhatsapp}>Call for Inquiry</a>
)}
</div>
</>
@@ -118,17 +117,16 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
</div>
</>
) : (
- <a href={callForPriceWhatsapp}>Call for price</a>
+ <a href={callForPriceWhatsapp}>Call for Inquiry</a>
)}
</div>
)}
- {product?.stockTotal > 0 && (
- <div className='flex gap-x-1'>
- <div className='badge-solid-red'>Ready Stock</div>
- <div className='badge-gray'>{product?.stockTotal > 5 ? '> 5' : '< 5'}</div>
- </div>
- )}
+ <div className='flex w-full items-center gap-x-1 '>
+ {product?.stockTotal > 0 && <div className='badge-solid-red'>Ready Stock</div>}
+ {/* <div className='badge-gray'>{product?.stockTotal > 5 ? '> 5' : '< 5'}</div> */}
+ {product?.qtySold > 0 && <div className='text-gray_r-9 text-[11px]'>{sellingProductFormat(product?.qtySold) + ' Terjual'}</div>}
+ </div>
</div>
</div>
)
@@ -186,9 +184,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
)}
<Link
href={createSlug('/shop/product/', product?.name, product?.id)}
- className={`mb-3 !text-gray_r-12 leading-6 ${
- simpleTitle ? 'line-clamp-2' : 'line-clamp-3'
- }`}
+ className={`mb-3 !text-gray_r-12 leading-6 line-clamp-3`}
>
{product?.name}
</Link>
@@ -209,7 +205,7 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
{product?.lowestPrice?.priceDiscount > 0 ? (
currencyFormat(product?.lowestPrice?.priceDiscount)
) : (
- <a href={callForPriceWhatsapp}>Call for price</a>
+ <a href={callForPriceWhatsapp}>Call for Inquiry</a>
)}
</div>
</>
@@ -224,17 +220,16 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
</div>
</>
) : (
- <a href={callForPriceWhatsapp}>Call for price</a>
+ <a href={callForPriceWhatsapp}>Call for Inquiry</a>
)}
</div>
)}
- {product?.stockTotal > 0 && (
- <div className='flex gap-x-1'>
- <div className='badge-solid-red'>Ready Stock</div>
- <div className='badge-gray'>{product?.stockTotal > 5 ? '> 5' : '< 5'}</div>
- </div>
- )}
+ <div className='flex w-full items-center gap-x-1 '>
+ {product?.stockTotal > 0 && <div className='badge-solid-red'>Ready Stock</div>}
+ {/* <div className='badge-gray'>{product?.stockTotal > 5 ? '> 5' : '< 5'}</div> */}
+ {product?.qtySold > 0 && <div className='text-gray_r-9 text-[11px]'>{sellingProductFormat(product?.qtySold) + ' Terjual'}</div>}
+ </div>
</div>
</div>
)