From f356538cd4ad808f90c363e6d7df2a19c4993713 Mon Sep 17 00:00:00 2001
From: Miqdad <ahmadmiqdad27@gmail.com>
Date: Fri, 24 Oct 2025 15:20:35 +0700
Subject: <Miqdad> Fake Stock

---
 .../product/components/Product/ProductDesktopVariant.jsx   | 14 +++++++++++++-
 1 file changed, 13 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 59fa2032..44ae04bd 100644
--- a/src/lib/product/components/Product/ProductDesktopVariant.jsx
+++ b/src/lib/product/components/Product/ProductDesktopVariant.jsx
@@ -296,6 +296,11 @@ const ProductDesktopVariant = ({
     fetchData();
   }, [product]);
 
+  const [fakeStock] = useState(() => {
+    // inisialisasi sekali doang pas pertama kali komponen dibuat
+    return Math.floor(Math.random() * 100) + 1;
+  });
+
   useEffect(() => {
     const fetchData = async () => {
       const qty_available = await odooApi(
@@ -530,7 +535,7 @@ const ProductDesktopVariant = ({
               </div>
 
               <div>
-                <Skeleton
+                {/* <Skeleton
                   isLoaded={!isLoadingSLA}
                   h='21px'
                   // w={16}
@@ -539,6 +544,13 @@ const ProductDesktopVariant = ({
                   }
                 >
                   Stock : {product?.sla?.qty}{' '}
+                </Skeleton> */}
+                <Skeleton
+                  isLoaded={!isLoadingSLA}
+                  h='21px'
+                  className={fakeStock < 10 ? 'text-red-600 font-medium' : ''}
+                >
+                  Stock : {fakeStock}{' '}
                 </Skeleton>
               </div>
               <div>
-- 
cgit v1.2.3

