From 6bd88bdb765c1ecc0518abeca77eca25bde2857b Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Tue, 17 Oct 2023 14:57:48 +0700
Subject: add lebel product terjual di product card dan product detail, bugfix
 queri solr untuk filter brand

---
 src/lib/product/components/ProductCard.jsx | 23 +++++++++++------------
 1 file changed, 11 insertions(+), 12 deletions(-)

(limited to 'src/lib/product/components/ProductCard.jsx')

diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx
index 3b96ac32..72a3260e 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'
@@ -123,12 +124,11 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
             </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-sm'>{sellingProductFormat(product?.qtySold) + ' Terjual'}</div>}
+          </div>
         </div>
       </div>
     )
@@ -229,12 +229,11 @@ const ProductCard = ({ product, simpleTitle, variant = 'vertical' }) => {
             </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-sm'>{sellingProductFormat(product?.qtySold) + ' Terjual'}</div>}
+          </div>
         </div>
       </div>
     )
-- 
cgit v1.2.3


From f03be42400890aaa4b5a8480b9f1da9c2004a6fc Mon Sep 17 00:00:00 2001
From: "HATEC\\SPVDEV001" <tri.susilo@altama.co.id>
Date: Tue, 17 Oct 2023 15:03:14 +0700
Subject: Cr title line jadi max 3

---
 src/lib/product/components/ProductCard.jsx | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

(limited to 'src/lib/product/components/ProductCard.jsx')

diff --git a/src/lib/product/components/ProductCard.jsx b/src/lib/product/components/ProductCard.jsx
index 72a3260e..c60e4f87 100644
--- a/src/lib/product/components/ProductCard.jsx
+++ b/src/lib/product/components/ProductCard.jsx
@@ -83,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}
@@ -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>
-- 
cgit v1.2.3

