From fa7c4c4645a90f23a59a84ea27e19dcde81ec159 Mon Sep 17 00:00:00 2001
From: trisusilo48 <tri.susilo@altama.co.id>
Date: Thu, 3 Oct 2024 09:41:51 +0700
Subject: prodcut variant

---
 .../components/Product/ProductDesktopVariant.jsx   | 146 +++++++++++++++------
 1 file changed, 103 insertions(+), 43 deletions(-)

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

diff --git a/src/lib/product/components/Product/ProductDesktopVariant.jsx b/src/lib/product/components/Product/ProductDesktopVariant.jsx
index 09b30a44..2f2caa56 100644
--- a/src/lib/product/components/Product/ProductDesktopVariant.jsx
+++ b/src/lib/product/components/Product/ProductDesktopVariant.jsx
@@ -1,7 +1,6 @@
-
-import { Box, Skeleton, Tooltip } from '@chakra-ui/react';
+import { Box, Button, Skeleton, Tooltip } from '@chakra-ui/react';
 import { HeartIcon } from '@heroicons/react/24/outline';
-import { Info } from 'lucide-react';
+import { Info, MessageCircleIcon, Share2Icon } from 'lucide-react';
 import { useRouter } from 'next/router';
 import { useCallback, useEffect, useRef, useState } from 'react';
 import { toast } from 'react-hot-toast';
@@ -22,6 +21,7 @@ import whatsappUrl from '@/core/utils/whatsappUrl';
 import productSimilarApi from '../../api/productSimilarApi';
 import ProductCard from '../ProductCard';
 import ProductSimilar from '../ProductSimilar';
+import { RWebShare } from 'react-web-share';
 
 const ProductDesktopVariant = ({
   product,
@@ -33,6 +33,8 @@ const ProductDesktopVariant = ({
   const auth = useAuth();
   const { slug } = router.query;
 
+  console.log('ini product variant', product);
+
   const [lowestPrice, setLowestPrice] = useState(null);
 
   const [addCartAlert, setAddCartAlert] = useState(false);
@@ -40,6 +42,8 @@ const ProductDesktopVariant = ({
 
   const { setRefreshCart } = useProductCartContext();
 
+  const [quantityInput, setQuantityInput] = useState(1);
+
   const getLowestPrice = useCallback(() => {
     const lowest = product.price;
     /* const lowest = prices.reduce((lowest, price) => {
@@ -160,24 +164,20 @@ const ProductDesktopVariant = ({
               <Image
                 src={product.image + '?variant=True'}
                 alt={product.name}
-                className='h-[430px] object-contain object-center w-full border border-gray_r-4'
+                className='w-full h-[350px]'
               />
             </div>
 
-            <div className='w-7/12 px-4'>
+            <div className='w-7/12 px-6'>
               <h1 className='text-title-md leading-10 font-medium'>
                 {product?.name}
               </h1>
               <div className='mt-10'>
-                <div className='flex p-3'>
-                  <div className='w-4/12 text-gray_r-12/70'>Nomor SKU</div>
-                  <div className='w-8/12'>SKU-{product.id}</div>
-                </div>
                 <div className='flex p-3 bg-gray_r-4'>
-                  <div className='w-4/12 text-gray_r-12/70'>Part Number</div>
-                  <div className='w-8/12'>{product.code || '-'}</div>
+                  <div className='w-4/12 text-gray_r-12/70'>Item Code</div>
+                  <div className='w-8/12'>{product.code}</div>
                 </div>
-                <div className='flex p-3'>
+                <div className='flex p-3 '>
                   <div className='w-4/12 text-gray_r-12/70'>Manufacture</div>
                   <div className='w-8/12'>
                     {product.manufacture?.name ? (
@@ -216,7 +216,7 @@ const ProductDesktopVariant = ({
                   </div>
                 </div>
 
-                <div className='flex p-3'>
+                {/* <div className='flex p-3'>
                   <div className='w-4/12 text-gray_r-12/70'>Stock</div>
                   <div className='w-8/12'>
                     {!product?.sla && <Skeleton width='10%' height='16px' />}
@@ -239,8 +239,9 @@ const ProductDesktopVariant = ({
                       </a>
                     )}
                   </div>
-                </div>
-                <div className='flex p-3 bg-gray_r-4'>
+                </div> */}
+
+                <div className='flex p-3 '>
                   <div className='w-4/12 text-gray_r-12/70'>Berat Barang</div>
                   <div className='w-8/12'>
                     {product?.weight > 0 && <span>{product?.weight} KG</span>}
@@ -266,20 +267,23 @@ const ProductDesktopVariant = ({
             </div>
 
             <div className='p-4 md:p-6 md:bg-gray-50 rounded-xl'>
-              <h2 className='text-h-md md:text-h-lg font-medium'>Informasi Produk</h2>
+              <h2 className='text-h-md md:text-h-lg font-medium'>
+                Informasi Produk
+              </h2>
               <div className='h-4' />
               <div
                 className='leading-relaxed text-gray-700'
                 dangerouslySetInnerHTML={{
                   __html:
-                    !product.parent.description || product.parent.description == '<p><br></p>'
+                    !product.parent.description ||
+                    product.parent.description == '<p><br></p>'
                       ? 'Belum ada deskripsi'
                       : product.parent.description,
                 }}
               />
             </div>
           </div>
-          <div className='w-[25%]'>
+          <div className='w-[33%]'>
             {product?.isFlashsale > 0 &&
             product?.price?.discountPercentage > 0 ? (
               <>
@@ -338,39 +342,95 @@ const ProductDesktopVariant = ({
               </h3>
             )}
             <div className='flex gap-x-3 mt-4'>
-              <input
-                type='number'
-                className='form-input w-16 py-2 text-center bg-gray_r-1'
-                ref={setVariantQuantityRef(product.id)}
-                defaultValue={1}
-              />
-              <button
-                type='button'
+              <div className='relative flex items-center'>
+                <button
+                  type='button'
+                  className='absolute left-0 px-2 py-1 h-full text-gray-500'
+                  onClick={() =>
+                    setQuantityInput(
+                      String(Math.max(1, Number(quantityInput) - 1))
+                    )
+                  }
+                >
+                  -
+                </button>
+                <input
+                  type='number'
+                  id='quantity'
+                  min={1}
+                  value={quantityInput}
+                  onChange={(e) => setQuantityInput(e.target.value)}
+                  className=' w-24 h-10 text-center border border-gray-300 rounded focus:outline-none'
+                />
+                <button
+                  type='button'
+                  className='absolute right-0 px-2 py-1 h-full text-gray-500'
+                  onClick={() =>
+                    setQuantityInput(String(Number(quantityInput) + 1))
+                  }
+                >
+                  +
+                </button>
+              </div>
+            </div>
+            <div className='flex gap-x-3 mt-4'>
+              <Button
                 onClick={() => handleAddToCart(product.id)}
-                className='flex-1 py-2 btn-yellow'
+                className='w-full'
+                colorScheme='yellow'
               >
                 Keranjang
-              </button>
-              <button
-                type='button'
+              </Button>
+              <Button
                 onClick={() => handleBuy(product.id)}
-                className='flex-1 py-2 btn-solid-red'
+                className='w-full'
+                colorScheme='red'
               >
                 Beli
-              </button>
+              </Button>
             </div>
             <div className='flex mt-4'>
-              <button
-                className='flex items-center gap-x-1'
-                onClick={toggleWishlist}
-              >
-                {wishlist.data?.productTotal > 0 ? (
-                  <HeartIcon className='w-6 fill-danger-500 text-danger-500' />
-                ) : (
-                  <HeartIcon className='w-6' />
-                )}
-                Wishlist
-              </button>
+              <div className='flex gap-x-5 items-center justify-center'>
+                <Button
+                  variant='link'
+                  target='_blank'
+                  colorScheme='gray'
+                  leftIcon={<MessageCircleIcon size={18} />}
+                >
+                  Ask Admin
+                </Button>
+
+                <span>|</span>
+
+                <button
+                  className='flex items-center gap-x-1'
+                  onClick={toggleWishlist}
+                >
+                  {wishlist.data?.productTotal > 0 ? (
+                    <HeartIcon className='w-6 fill-danger-500 text-danger-500' />
+                  ) : (
+                    <HeartIcon className='w-6' />
+                  )}
+                  Wishlist
+                </button>
+
+                <span>|</span>
+
+                <RWebShare
+                  data={{
+                    text: 'Check out this product',
+                    title: `${product.name} - Indoteknik.com`,
+                  }}
+                >
+                  <Button
+                    variant='link'
+                    colorScheme='gray'
+                    leftIcon={<Share2Icon size={18} />}
+                  >
+                    Share
+                  </Button>
+                </RWebShare>
+              </div>
             </div>
             <div className='border border-gray_r-6 overflow-auto mt-4'>
               <div className='font-medium text-center p-4 bg-gray_r-1 border-b border-gray_r-6 sticky top-0 z-10'>
-- 
cgit v1.2.3


From ca30c28dd0b19977eb771fc32ff5e520cdef1068 Mon Sep 17 00:00:00 2001
From: trisusilo48 <tri.susilo@altama.co.id>
Date: Thu, 3 Oct 2024 16:47:37 +0700
Subject: product varian

---
 .../components/Product/ProductDesktopVariant.jsx   | 185 +++++++++++----------
 1 file changed, 101 insertions(+), 84 deletions(-)

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

diff --git a/src/lib/product/components/Product/ProductDesktopVariant.jsx b/src/lib/product/components/Product/ProductDesktopVariant.jsx
index 2f2caa56..55effdfb 100644
--- a/src/lib/product/components/Product/ProductDesktopVariant.jsx
+++ b/src/lib/product/components/Product/ProductDesktopVariant.jsx
@@ -18,10 +18,13 @@ import currencyFormat from '@/core/utils/currencyFormat';
 import { createSlug } from '@/core/utils/slug';
 import whatsappUrl from '@/core/utils/whatsappUrl';
 
+import { RWebShare } from 'react-web-share';
 import productSimilarApi from '../../api/productSimilarApi';
 import ProductCard from '../ProductCard';
 import ProductSimilar from '../ProductSimilar';
-import { RWebShare } from 'react-web-share';
+import ProductPromoSection from '~/modules/product-promo/components/Section';
+
+const SELF_HOST = process.env.NEXT_PUBLIC_SELF_HOST;
 
 const ProductDesktopVariant = ({
   product,
@@ -44,11 +47,18 @@ const ProductDesktopVariant = ({
 
   const [quantityInput, setQuantityInput] = useState(1);
 
+  const createdAskUrl = whatsappUrl({
+    template: 'product',
+    payload: {
+      manufacture: product.manufacture.name,
+      productName: product.name,
+      url: process.env.NEXT_PUBLIC_SELF_HOST + router.asPath,
+    },
+    fallbackUrl: router.asPath,
+  });
+
   const getLowestPrice = useCallback(() => {
     const lowest = product.price;
-    /* const lowest = prices.reduce((lowest, price) => {
-      return price.priceDiscount < lowest.priceDiscount ? price : lowest
-    }, prices[0])*/
     return lowest;
   }, [product]);
 
@@ -81,7 +91,7 @@ const ProductDesktopVariant = ({
       router.push(`/login?next=/shop/product/${slug}`);
       return;
     }
-    const quantity = variantQuantityRefs.current[product.id].value;
+    const quantity = quantityInput;
     if (!validQuantity(quantity)) return;
     updateItemCart({
       productId: product.id,
@@ -96,7 +106,7 @@ const ProductDesktopVariant = ({
   };
 
   const handleBuy = (variant) => {
-    const quantity = variantQuantityRefs.current[product.id].value;
+    const quantity = quantityInput;
     if (!validQuantity(quantity)) return;
 
     updateItemCart({
@@ -177,71 +187,26 @@ const ProductDesktopVariant = ({
                   <div className='w-4/12 text-gray_r-12/70'>Item Code</div>
                   <div className='w-8/12'>{product.code}</div>
                 </div>
-                <div className='flex p-3 '>
+                <div className='flex p-3 items-center '>
                   <div className='w-4/12 text-gray_r-12/70'>Manufacture</div>
                   <div className='w-8/12'>
-                    {product.manufacture?.name ? (
-                      <Link
-                        href={createSlug(
-                          '/shop/brands/',
-                          product.manufacture?.name,
-                          product.manufacture?.id
-                        )}
-                      >
-                        {product.manufacture?.name}
-                      </Link>
-                    ) : (
-                      <div>-</div>
-                    )}
-                  </div>
-                </div>
-
-                <div className='flex p-3 items-center bg-gray_r-4'>
-                  <div className='w-4/12 text-gray_r-12/70'>
-                    Persiapan Barang
-                  </div>
-                  <div className='w-8/12'>
-                    {!product?.sla && <Skeleton width='20%' height='16px' />}
-                    {product?.sla && (
-                      <Tooltip
-                        placement='top'
-                        label={`Masa Persiapan Barang ${product?.sla?.slaDate}`}
-                      >
-                        <Box className='w-fit flex items-center gap-x-2'>
-                          {product?.sla?.slaDate}
-                          <Info size={16} />
-                        </Box>
-                      </Tooltip>
-                    )}
+                    <Link
+                      href={createSlug(
+                        '/shop/brands/',
+                        product.manufacture.name,
+                        product.manufacture.id.toString()
+                      )}
+                    >
+                      <Image
+                        width={100}
+                        src={product.manufacture.logo}
+                        alt={product.manufacture.name}
+                      />
+                    </Link>
                   </div>
                 </div>
 
-                {/* <div className='flex p-3'>
-                  <div className='w-4/12 text-gray_r-12/70'>Stock</div>
-                  <div className='w-8/12'>
-                    {!product?.sla && <Skeleton width='10%' height='16px' />}
-                    {product?.sla?.qty > 0 && <span>{product?.sla?.qty}</span>}
-                    {product?.sla?.qty == 0 && (
-                      <a
-                        href={whatsappUrl('product', {
-                          name: product.name,
-                          manufacture: product?.manufacture?.name,
-                          url: createSlug(
-                            '/shop/product/',
-                            product.name,
-                            product.id,
-                            true
-                          ),
-                        })}
-                        className='text-danger-500 font-medium'
-                      >
-                        Tanya Admin
-                      </a>
-                    )}
-                  </div>
-                </div> */}
-
-                <div className='flex p-3 '>
+                <div className='flex p-3 bg-gray_r-4 '>
                   <div className='w-4/12 text-gray_r-12/70'>Berat Barang</div>
                   <div className='w-8/12'>
                     {product?.weight > 0 && <span>{product?.weight} KG</span>}
@@ -263,24 +228,52 @@ const ProductDesktopVariant = ({
                     )}
                   </div>
                 </div>
+                <div className='flex p-3 items-center '>
+                  <div className='w-4/12 text-gray_r-12/70'>Terjual</div>
+                  <div className='w-8/12'>-</div>
+                </div>
+
+                <div className='flex p-3 items-center bg-gray_r-4 '>
+                  <div className='w-4/12 text-gray_r-12/70'>
+                    Persiapan Barang
+                  </div>
+                  <div className='w-8/12'>
+                    {!product?.sla && <Skeleton width='20%' height='16px' />}
+                    {product?.sla && (
+                      <Tooltip
+                        placement='top'
+                        label={`Masa Persiapan Barang ${product?.sla?.slaDate}`}
+                      >
+                        <Box className='w-fit flex items-center gap-x-2'>
+                          {product?.sla?.slaDate}
+                          <Info size={16} />
+                        </Box>
+                      </Tooltip>
+                    )}
+                  </div>
+                </div>
               </div>
             </div>
 
-            <div className='p-4 md:p-6 md:bg-gray-50 rounded-xl'>
-              <h2 className='text-h-md md:text-h-lg font-medium'>
-                Informasi Produk
-              </h2>
-              <div className='h-4' />
-              <div
-                className='leading-relaxed text-gray-700'
-                dangerouslySetInnerHTML={{
-                  __html:
-                    !product.parent.description ||
-                    product.parent.description == '<p><br></p>'
-                      ? 'Belum ada deskripsi'
-                      : product.parent.description,
-                }}
-              />
+            <div className='p-4 md:p-6 '>
+              <ProductPromoSection product={product} productId={product.id} />
+
+              <div className='p-4 md:p-6 md:bg-gray-50 rounded-xl'>
+                <h2 className='text-h-md md:text-h-lg font-medium'>
+                  Informasi Produk
+                </h2>
+                <div className='h-4' />
+                <div
+                  className='leading-relaxed text-gray-700'
+                  dangerouslySetInnerHTML={{
+                    __html:
+                      !product.parent.description ||
+                      product.parent.description == '<p><br></p>'
+                        ? 'Belum ada deskripsi'
+                        : product.parent.description,
+                  }}
+                />
+              </div>
             </div>
           </div>
           <div className='w-[33%]'>
@@ -341,7 +334,7 @@ const ProductDesktopVariant = ({
                 )}
               </h3>
             )}
-            <div className='flex gap-x-3 mt-4'>
+            <div className='flex justify-between items-center py-5 px-3'>
               <div className='relative flex items-center'>
                 <button
                   type='button'
@@ -372,8 +365,29 @@ const ProductDesktopVariant = ({
                   +
                 </button>
               </div>
+              <div>
+                <span
+                  className={
+                    product?.sla?.qty < 10 ? 'text-red-600 font-medium' : ''
+                  }
+                >
+                  {' '}
+                  Stock : {product?.sla?.qty}{' '}
+                </span>
+              </div>
+              <div>
+                {product?.sla?.qty > 0 && (
+                  <Link href='/panduan-pick-up-service' className='group'>
+                    <Image
+                      src='/images/PICKUP-NOW.png'
+                      className='group-hover:scale-105 transition-transform duration-200 w-28'
+                      alt='pickup now'
+                    />
+                  </Link>
+                )}
+              </div>
             </div>
-            <div className='flex gap-x-3 mt-4'>
+            <div className='flex gap-x-3'>
               <Button
                 onClick={() => handleAddToCart(product.id)}
                 className='w-full'
@@ -389,9 +403,11 @@ const ProductDesktopVariant = ({
                 Beli
               </Button>
             </div>
-            <div className='flex mt-4'>
+            <div className='flex py-5'>
               <div className='flex gap-x-5 items-center justify-center'>
                 <Button
+                  as={Link}
+                  href={createdAskUrl}
                   variant='link'
                   target='_blank'
                   colorScheme='gray'
@@ -420,6 +436,7 @@ const ProductDesktopVariant = ({
                   data={{
                     text: 'Check out this product',
                     title: `${product.name} - Indoteknik.com`,
+                    url: SELF_HOST + router.asPath,
                   }}
                 >
                   <Button
-- 
cgit v1.2.3


From 6d89fa79c9fdbb1961b15a463250f28e5c684b4a Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Wed, 16 Oct 2024 13:33:00 +0700
Subject: <iman> delete console log

---
 src/lib/product/components/Product/ProductDesktopVariant.jsx | 2 --
 1 file changed, 2 deletions(-)

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

diff --git a/src/lib/product/components/Product/ProductDesktopVariant.jsx b/src/lib/product/components/Product/ProductDesktopVariant.jsx
index 55effdfb..2e005eea 100644
--- a/src/lib/product/components/Product/ProductDesktopVariant.jsx
+++ b/src/lib/product/components/Product/ProductDesktopVariant.jsx
@@ -36,8 +36,6 @@ const ProductDesktopVariant = ({
   const auth = useAuth();
   const { slug } = router.query;
 
-  console.log('ini product variant', product);
-
   const [lowestPrice, setLowestPrice] = useState(null);
 
   const [addCartAlert, setAddCartAlert] = useState(false);
-- 
cgit v1.2.3


From 7350eb1edcfb7e9776fec70849ee0c64a795eda3 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Thu, 24 Oct 2024 11:35:14 +0700
Subject: <iman> add penawaran instan mobile

---
 .../components/Product/ProductDesktopVariant.jsx   | 31 +++++++++++++++++++++-
 1 file changed, 30 insertions(+), 1 deletion(-)

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

diff --git a/src/lib/product/components/Product/ProductDesktopVariant.jsx b/src/lib/product/components/Product/ProductDesktopVariant.jsx
index 55effdfb..e04e0d16 100644
--- a/src/lib/product/components/Product/ProductDesktopVariant.jsx
+++ b/src/lib/product/components/Product/ProductDesktopVariant.jsx
@@ -17,7 +17,7 @@ import { updateItemCart } from '@/core/utils/cart';
 import currencyFormat from '@/core/utils/currencyFormat';
 import { createSlug } from '@/core/utils/slug';
 import whatsappUrl from '@/core/utils/whatsappUrl';
-
+import ImageNext from 'next/image';
 import { RWebShare } from 'react-web-share';
 import productSimilarApi from '../../api/productSimilarApi';
 import ProductCard from '../ProductCard';
@@ -119,6 +119,20 @@ const ProductDesktopVariant = ({
     router.push(`/shop/checkout?source=buy`);
   };
 
+  const handleButton = (variant) => {
+    const quantity = quantityInput;
+    if (!validQuantity(quantity)) return;
+
+    updateItemCart({
+      productId: variant,
+      quantity,
+      programLineId: null,
+      selected: true,
+      source: 'buy',
+    });
+    router.push('/shop/quotation?source=buy');
+  };
+
   const variantSectionRef = useRef(null);
   const goToVariantSection = () => {
     if (variantSectionRef.current) {
@@ -403,6 +417,21 @@ const ProductDesktopVariant = ({
                 Beli
               </Button>
             </div>
+            <Button
+              onClick={() => handleButton(product.id)}
+              color={'red'}
+              colorScheme='white'
+              className='w-full border-2 p-2 gap-1 mt-2 hover:bg-slate-100 flex items-center'
+            >
+              <ImageNext
+                src='/images/writing.png'
+                alt='penawaran instan'
+                className=''
+                width={25}
+                height={25}
+              />
+              Penawaran Harga Instan
+            </Button>
             <div className='flex py-5'>
               <div className='flex gap-x-5 items-center justify-center'>
                 <Button
-- 
cgit v1.2.3


From c64472c479ec282af9b606a76358922b25752be0 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Fri, 25 Oct 2024 15:03:53 +0700
Subject: <iman> update revisi CR

---
 src/lib/product/components/Product/ProductDesktopVariant.jsx | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

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

diff --git a/src/lib/product/components/Product/ProductDesktopVariant.jsx b/src/lib/product/components/Product/ProductDesktopVariant.jsx
index 2e005eea..32ce345e 100644
--- a/src/lib/product/components/Product/ProductDesktopVariant.jsx
+++ b/src/lib/product/components/Product/ProductDesktopVariant.jsx
@@ -364,14 +364,16 @@ const ProductDesktopVariant = ({
                 </button>
               </div>
               <div>
-                <span
+                <Skeleton
+                  isLoaded={sla}
+                  h='21px'
+                  // w={16}
                   className={
                     product?.sla?.qty < 10 ? 'text-red-600 font-medium' : ''
                   }
                 >
-                  {' '}
                   Stock : {product?.sla?.qty}{' '}
-                </span>
+                </Skeleton>
               </div>
               <div>
                 {product?.sla?.qty > 0 && (
-- 
cgit v1.2.3


From 4368e38cce90e401a0ba141f2b20d23db1886cf8 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Wed, 13 Nov 2024 11:05:25 +0700
Subject: <iman> fix bug ao shipment pagination

---
 src/lib/product/components/Product/ProductDesktopVariant.jsx | 1 -
 1 file changed, 1 deletion(-)

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

diff --git a/src/lib/product/components/Product/ProductDesktopVariant.jsx b/src/lib/product/components/Product/ProductDesktopVariant.jsx
index cca8ec5e..f4569574 100644
--- a/src/lib/product/components/Product/ProductDesktopVariant.jsx
+++ b/src/lib/product/components/Product/ProductDesktopVariant.jsx
@@ -231,7 +231,6 @@ const ProductDesktopVariant = ({
     };
     fetchData();
   }, [product]);
-  console.log('product', product);
 
   return (
     <DesktopView>
-- 
cgit v1.2.3


From 31fca1b5d023abb96aad53ac2e26b77ce16e51e1 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Fri, 15 Nov 2024 09:23:29 +0700
Subject: <iman> update error code

---
 src/lib/product/components/Product/ProductDesktopVariant.jsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

diff --git a/src/lib/product/components/Product/ProductDesktopVariant.jsx b/src/lib/product/components/Product/ProductDesktopVariant.jsx
index f4569574..6fe75fff 100644
--- a/src/lib/product/components/Product/ProductDesktopVariant.jsx
+++ b/src/lib/product/components/Product/ProductDesktopVariant.jsx
@@ -434,7 +434,7 @@ const ProductDesktopVariant = ({
               </div>
               <div>
                 <Skeleton
-                  isLoaded={sla}
+                  isLoaded={!isLoadingSLA}
                   h='21px'
                   // w={16}
                   className={
-- 
cgit v1.2.3


From 49f2e6a5612d000c3a740513c1a54b73bb656d77 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Fri, 15 Nov 2024 09:52:30 +0700
Subject: <iman> if has image brand then show brand image else brand name

---
 .../product/components/Product/ProductDesktopVariant.jsx | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

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

diff --git a/src/lib/product/components/Product/ProductDesktopVariant.jsx b/src/lib/product/components/Product/ProductDesktopVariant.jsx
index 6fe75fff..5dfd452b 100644
--- a/src/lib/product/components/Product/ProductDesktopVariant.jsx
+++ b/src/lib/product/components/Product/ProductDesktopVariant.jsx
@@ -264,11 +264,17 @@ const ProductDesktopVariant = ({
                         product.manufacture.id.toString()
                       )}
                     >
-                      <Image
-                        width={100}
-                        src={product.manufacture.logo}
-                        alt={product.manufacture.name}
-                      />
+                      {product?.manufacture.logo ? (
+                        <Image
+                          width={100}
+                          src={product.manufacture.logo}
+                          alt={product.manufacture.name}
+                        />
+                      ) : (
+                        <p className='font-bold text-red-500'>
+                          {product.manufacture.name}
+                        </p>
+                      )}
                     </Link>
                   </div>
                 </div>
-- 
cgit v1.2.3

