diff options
| author | Miqdad <ahmadmiqdad27@gmail.com> | 2025-10-23 11:46:50 +0700 |
|---|---|---|
| committer | Miqdad <ahmadmiqdad27@gmail.com> | 2025-10-23 11:46:50 +0700 |
| commit | aa9095187a0678940efa2a5db82ac6c883d1d6ac (patch) | |
| tree | 3e9b4cf1d929916e73cffad8b6e8aa5112f7ceaf | |
| parent | 1cb3a8da9091bb2925898b72e3dadf7a521dfc0b (diff) | |
<Miqdad> fix qty sold
| -rw-r--r-- | src/lib/product/components/ProductCard.jsx | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx index 026de18b..5908f1ee 100644 --- a/src/lib/product/components/ProductCard.jsx +++ b/src/lib/product/components/ProductCard.jsx @@ -295,12 +295,19 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { )} <div className='flex w-full items-center gap-x-1 '> - {product?.stockTotal > 0 && ( - <div className='badge-solid-red'>Ready Stock</div> - )} - {product?.qtySold > 0 && ( - <div className='text-gray_r-9 text-[11px]'> - {sellingProductFormat(product?.qtySold) + ' Terjual'} + {(product?.stockTotal > 0 || product?.qtySold > 0) && ( + <div className='flex w-full items-center gap-x-2 flex-nowrap min-w-0'> + {product?.stockTotal > 0 && ( + <div className='badge-solid-red text-center shrink-0 whitespace-nowrap'> + Ready Stock + </div> + )} + + {product?.qtySold > 0 && ( + <div className='text-gray_r-9 text-[11px] flex-1 min-w-0 truncate'> + {sellingProductFormat(product?.qtySold)} Terjual + </div> + )} </div> )} </div> @@ -501,14 +508,15 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => { )} {(product?.stockTotal > 0 || product?.qtySold > 0) && ( - <div className='flex w-full items-center gap-x-2'> + <div className='flex w-full items-center gap-x-2 flex-nowrap min-w-0'> {product?.stockTotal > 0 && ( - <div className='badge-solid-red text-center'> + <div className='badge-solid-red text-center shrink-0 whitespace-nowrap'> Ready Stock </div> )} + {product?.qtySold > 0 && ( - <div className='text-gray_r-9 text-[11px] whitespace-nowrap'> + <div className='text-gray_r-9 text-[11px] flex-1 min-w-0 truncate'> {sellingProductFormat(product?.qtySold)} Terjual </div> )} |
