From 2ce7d2605e3c20963589a19abd5ae3e9f6aae6fe Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Thu, 23 Jan 2025 09:28:23 +0700
Subject: <iman> set selected varian ke yang is_in_bu = true

---
 src-migrate/modules/product-detail/components/ProductDetail.tsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'src-migrate/modules/product-detail/components/ProductDetail.tsx')

diff --git a/src-migrate/modules/product-detail/components/ProductDetail.tsx b/src-migrate/modules/product-detail/components/ProductDetail.tsx
index b036cc2d..f23aa9dc 100644
--- a/src-migrate/modules/product-detail/components/ProductDetail.tsx
+++ b/src-migrate/modules/product-detail/components/ProductDetail.tsx
@@ -66,7 +66,11 @@ const ProductDetail = ({ product }: Props) => {
     if (typeof auth === 'object') {
       setIsApproval(auth?.feature?.soApproval);
     }
-    setSelectedVariant(product?.variants[0])
+    const selectedVariant =
+      product?.variants?.find((variant) => variant.is_in_bu) ||
+      product?.variants?.[0];
+    setSelectedVariant(selectedVariant);
+    // setSelectedVariant(product?.variants[0])
   }, []);
 
   return (
-- 
cgit v1.2.3


From 71c0fa812ff0c5e82721754f496501b5a61bf226 Mon Sep 17 00:00:00 2001
From: trisusilo48 <tri.susilo@altama.co.id>
Date: Mon, 24 Mar 2025 10:12:27 +0700
Subject: handling desc table

---
 .../product-detail/components/ProductDetail.tsx    | 28 ++++++++++++++--------
 1 file changed, 18 insertions(+), 10 deletions(-)

(limited to 'src-migrate/modules/product-detail/components/ProductDetail.tsx')

diff --git a/src-migrate/modules/product-detail/components/ProductDetail.tsx b/src-migrate/modules/product-detail/components/ProductDetail.tsx
index f23aa9dc..4667e086 100644
--- a/src-migrate/modules/product-detail/components/ProductDetail.tsx
+++ b/src-migrate/modules/product-detail/components/ProductDetail.tsx
@@ -106,7 +106,12 @@ const ProductDetail = ({ product }: Props) => {
             )}
 
             <div className='h-4 md:h-10' />
-            {!!activeVariantId && !isApproval && <ProductPromoSection product={product} productId={activeVariantId} />}
+            {!!activeVariantId && !isApproval && (
+              <ProductPromoSection
+                product={product}
+                productId={activeVariantId}
+              />
+            )}
 
             {/* <div className={style['section-card']}>
               <h2 className={style['heading']}>
@@ -121,15 +126,18 @@ const ProductDetail = ({ product }: Props) => {
             <div className={style['section-card']}>
               <h2 className={style['heading']}>Informasi Produk</h2>
               <div className='h-4' />
-              <div
-                className={style['description']}
-                dangerouslySetInnerHTML={{
-                  __html:
-                    !product.description || product.description == '<p><br></p>'
-                      ? 'Belum ada deskripsi'
-                      : product.description,
-                }}
-              />
+              <div className='overflow-x-auto'>
+                <div
+                  className={style['description']}
+                  dangerouslySetInnerHTML={{
+                    __html:
+                      !product.description ||
+                      product.description == '<p><br></p>'
+                        ? 'Belum ada deskripsi'
+                        : product.description,
+                  }}
+                />
+              </div>
             </div>
           </div>
         </div>
-- 
cgit v1.2.3

