From 517dce1136351f57e68e08f632635ac0a1ab6bff Mon Sep 17 00:00:00 2001
From: Mqdd <ahmadmiqdad27@gmail.com>
Date: Mon, 15 Dec 2025 13:10:42 +0700
Subject: <Miqdad> fix bug select variant

---
 .../modules/product-detail/components/ProductDetail.tsx      | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(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 085bbb1c..129ca8de 100644
--- a/src-migrate/modules/product-detail/components/ProductDetail.tsx
+++ b/src-migrate/modules/product-detail/components/ProductDetail.tsx
@@ -83,6 +83,18 @@ const ProductDetail = ({ product }: Props) => {
     setAskAdminUrl(createdAskUrl);
   }, [router.asPath, product.manufacture.name, product.name, setAskAdminUrl]);
 
+  // useEffect(() => {
+  //   if (!product?.variants?.length) return;
+
+  //   setIsApproval(auth?.feature?.soApproval);
+
+  //   setSelectedVariant((prev: any) => {
+  //     if (prev) return prev;
+
+  //     return product.variants[0];
+  //   });
+  // }, [product?.id]);
+
   useEffect(() => {
     if (typeof auth === 'object') {
       setIsApproval(auth?.feature?.soApproval);
-- 
cgit v1.2.3

