From 87bc6b410b875d6f811e21e1e1d6f974e7cac653 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Tue, 5 Mar 2024 13:22:30 +0700
Subject: Update background flash sale

---
 src-migrate/modules/product-detail/components/Image.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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

diff --git a/src-migrate/modules/product-detail/components/Image.tsx b/src-migrate/modules/product-detail/components/Image.tsx
index b69cc87f..3d7777f8 100644
--- a/src-migrate/modules/product-detail/components/Image.tsx
+++ b/src-migrate/modules/product-detail/components/Image.tsx
@@ -67,7 +67,7 @@ const Image = ({ product }: Props) => {
         <div className='absolute bottom-0 w-full h-14'>
           <div className="relative w-full h-full">
             <ImageUI
-              src='/images/GAMBAR-BG-FLASH-SALE.jpg'
+              src='/images/BG-FLASH-SALE.jpg'
               alt='Flash Sale Indoteknik'
               width={200}
               height={100}
-- 
cgit v1.2.3


From f9f1fdf83c2b6ed5c1d85d7418d45aeed9b05c77 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Wed, 5 Jun 2024 15:24:42 +0700
Subject: <iman> add feature SNI-TKDR

---
 .../modules/product-detail/components/Image.tsx    | 89 +++++++++++++++++++---
 1 file changed, 79 insertions(+), 10 deletions(-)

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

diff --git a/src-migrate/modules/product-detail/components/Image.tsx b/src-migrate/modules/product-detail/components/Image.tsx
index 3d7777f8..1b80efa8 100644
--- a/src-migrate/modules/product-detail/components/Image.tsx
+++ b/src-migrate/modules/product-detail/components/Image.tsx
@@ -1,5 +1,5 @@
 import style from '../styles/image.module.css';
-
+import ImageNext from 'next/image';
 import React, { useEffect, useMemo, useState } from 'react'
 import { InfoIcon } from 'lucide-react'
 import { Tooltip } from '@chakra-ui/react'
@@ -17,6 +17,47 @@ const Image = ({ product }: Props) => {
 
   const [count, setCount] = useState(flashSale?.remaining_time || 0);
 
+  const [isSni, setIsSni] = useState(false);
+  const [isTkdn, setTkdn] = useState(false);
+
+  useEffect(() => {
+    // Lakukan pemanggilan API untuk memeriksa isSni
+    const fetchSniData = async () => {
+      try {
+        const response = await fetch('URL_API_SNI');
+        const data = await response.json();
+        if (data && data.sni) {
+          setIsSni(true);
+        } else {
+          setIsSni(false);
+        }
+      } catch (error) {
+        console.error('Error fetching SNI data:', error);
+        setIsSni(false);
+      }
+    };
+
+    // Lakukan pemanggilan API untuk memeriksa isTkdn
+    const fetchTkdnData = async () => {
+      try {
+        const response = await fetch('URL_API_TKDN');
+        const data = await response.json();
+        if (data && data.tkdn) {
+          setTkdn(true);
+        } else {
+          setTkdn(false);
+        }
+      } catch (error) {
+        console.error('Error fetching TKDN data:', error);
+        setTkdn(false);
+      }
+    };
+    fetchSniData();
+    fetchTkdnData();
+    return () => {
+    };
+  }, []);
+
   useEffect(() => {
     let interval: NodeJS.Timeout;
 
@@ -42,15 +83,43 @@ const Image = ({ product }: Props) => {
 
   return (
     <div className={style['wrapper']}>
-      <ImageUI
-        src={image}
-        alt={product.name}
-        width={256}
-        height={256}
-        className={style['image']}
-        loading='eager'
-        priority
-      />
+      {/* <div className="relative"> */}
+          <ImageUI
+            src={image}
+            alt={product.name}
+            width={256}
+            height={256}
+            className={style['image']}
+            loading='eager'
+            priority
+          />
+          <div className="absolute top-4 right-10 flex  ">
+            <div className="gambarB ">
+              {!isSni && (
+                <ImageNext
+                  src="/images/sni-logo.png"
+                  alt="SNI Logo"
+                  className="w-12 h-8 object-contain object-top   sm:h-6"
+                  width={50}
+                  height={50}
+                />
+              )}
+            </div>
+            <div className="gambarC  ">
+              {!isTkdn && (
+                <ImageNext
+                  src="/images/TKDN.png"
+                  alt="TKDN"
+                  className="w-16 h-8 object-contain object-top  ml-1 mr-1 sm:h-6"
+                  width={50}
+                  height={50}
+                />
+              )}
+            </div>
+          </div>
+        {/* </div> */}
+      
+      
 
       <div className={style['absolute-info']}>
         <Tooltip
-- 
cgit v1.2.3


From 755b61a8a7a082cc13f7ecb4a79807f90e60b3d6 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Wed, 5 Jun 2024 16:50:38 +0700
Subject: <iman> add feature SNI-TKDN

---
 .../modules/product-detail/components/Image.tsx    | 46 ++--------------------
 1 file changed, 3 insertions(+), 43 deletions(-)

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

diff --git a/src-migrate/modules/product-detail/components/Image.tsx b/src-migrate/modules/product-detail/components/Image.tsx
index 1b80efa8..30ca0d34 100644
--- a/src-migrate/modules/product-detail/components/Image.tsx
+++ b/src-migrate/modules/product-detail/components/Image.tsx
@@ -14,49 +14,9 @@ type Props = {
 
 const Image = ({ product }: Props) => {
   const flashSale = product.flash_sale
-
   const [count, setCount] = useState(flashSale?.remaining_time || 0);
 
-  const [isSni, setIsSni] = useState(false);
-  const [isTkdn, setTkdn] = useState(false);
-
-  useEffect(() => {
-    // Lakukan pemanggilan API untuk memeriksa isSni
-    const fetchSniData = async () => {
-      try {
-        const response = await fetch('URL_API_SNI');
-        const data = await response.json();
-        if (data && data.sni) {
-          setIsSni(true);
-        } else {
-          setIsSni(false);
-        }
-      } catch (error) {
-        console.error('Error fetching SNI data:', error);
-        setIsSni(false);
-      }
-    };
-
-    // Lakukan pemanggilan API untuk memeriksa isTkdn
-    const fetchTkdnData = async () => {
-      try {
-        const response = await fetch('URL_API_TKDN');
-        const data = await response.json();
-        if (data && data.tkdn) {
-          setTkdn(true);
-        } else {
-          setTkdn(false);
-        }
-      } catch (error) {
-        console.error('Error fetching TKDN data:', error);
-        setTkdn(false);
-      }
-    };
-    fetchSniData();
-    fetchTkdnData();
-    return () => {
-    };
-  }, []);
+  
 
   useEffect(() => {
     let interval: NodeJS.Timeout;
@@ -95,7 +55,7 @@ const Image = ({ product }: Props) => {
           />
           <div className="absolute top-4 right-10 flex  ">
             <div className="gambarB ">
-              {!isSni && (
+              {product.isSni && (
                 <ImageNext
                   src="/images/sni-logo.png"
                   alt="SNI Logo"
@@ -106,7 +66,7 @@ const Image = ({ product }: Props) => {
               )}
             </div>
             <div className="gambarC  ">
-              {!isTkdn && (
+              {product.isTkdn && (
                 <ImageNext
                   src="/images/TKDN.png"
                   alt="TKDN"
-- 
cgit v1.2.3

