From 982a18543beefdd33f20c294b06b7a1a87103b2f Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Thu, 7 Nov 2024 09:16:51 +0700
Subject: <iman> update mobile image

---
 src-migrate/modules/product-detail/components/Image.tsx | 6 ++++--
 1 file changed, 4 insertions(+), 2 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 29710df8..96ae2027 100644
--- a/src-migrate/modules/product-detail/components/Image.tsx
+++ b/src-migrate/modules/product-detail/components/Image.tsx
@@ -35,10 +35,12 @@ const Image = ({ product }: Props) => {
   }, [flashSale?.remaining_time]);
 
   const duration = moment.duration(count, 'seconds');
-  console.log('product', product);
   const image = useMemo(() => {
-    if (isMobile && product.image_mobile) {
+    if (!isDesktop && product.image_mobile) {
       return product.image_mobile + '?ratio=square';
+    } else {
+      if (product.image) return product.image + '?ratio=square';
+      return '/images/noimage.jpeg';
     }
   }, [product.image, product.image_mobile]);
 
-- 
cgit v1.2.3

