From 89f32128f37d99b490de7590e2116a9cfd853f89 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Fri, 22 Dec 2023 17:33:46 +0700
Subject: Update promotion program feature

---
 .../modules/product-promo/components/Item.tsx      | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 src-migrate/modules/product-promo/components/Item.tsx

(limited to 'src-migrate/modules/product-promo/components/Item.tsx')

diff --git a/src-migrate/modules/product-promo/components/Item.tsx b/src-migrate/modules/product-promo/components/Item.tsx
new file mode 100644
index 00000000..058b2f6c
--- /dev/null
+++ b/src-migrate/modules/product-promo/components/Item.tsx
@@ -0,0 +1,24 @@
+import style from '../styles/item.module.css'
+
+import React from 'react'
+import Image from 'next/image'
+
+import { IProductVariantPromo } from '~/common/types/promotion'
+
+type Props = {
+  variant: IProductVariantPromo
+}
+
+const ProductPromoItem = ({ variant }: Props) => {
+  return (
+    <div className={style.item}>
+      <div className={style.image}>
+        <Image src={variant.image} alt={variant.display_name} width={320} height={320} />
+        <div className={style.quantity}>{variant.qty} pcs</div>
+      </div>
+      <div className={style.name}>{variant.name}</div>
+    </div>
+  )
+}
+
+export default ProductPromoItem
\ No newline at end of file
-- 
cgit v1.2.3


From 67398e6f10d6f7729d8f1ace7005ef13d32c5ddd Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Thu, 4 Jan 2024 10:05:25 +0700
Subject: Update promotion program feature

---
 src-migrate/modules/product-promo/components/Item.tsx | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

(limited to 'src-migrate/modules/product-promo/components/Item.tsx')

diff --git a/src-migrate/modules/product-promo/components/Item.tsx b/src-migrate/modules/product-promo/components/Item.tsx
index 058b2f6c..15ca4878 100644
--- a/src-migrate/modules/product-promo/components/Item.tsx
+++ b/src-migrate/modules/product-promo/components/Item.tsx
@@ -6,15 +6,21 @@ import Image from 'next/image'
 import { IProductVariantPromo } from '~/common/types/promotion'
 
 type Props = {
-  variant: IProductVariantPromo
+  variant: IProductVariantPromo,
+  isFree?: boolean
 }
 
-const ProductPromoItem = ({ variant }: Props) => {
+const ProductPromoItem = ({
+  variant,
+  isFree = false
+}: Props) => {
   return (
     <div className={style.item}>
       <div className={style.image}>
-        <Image src={variant.image} alt={variant.display_name} width={320} height={320} />
-        <div className={style.quantity}>{variant.qty} pcs</div>
+        <Image src={variant.image} alt={variant.display_name} width={120} height={120} quality={100} />
+        <div className={style.quantity}>
+          {variant.qty} pcs {isFree ? '(free)' : ''}
+        </div>
       </div>
       <div className={style.name}>{variant.name}</div>
     </div>
-- 
cgit v1.2.3


From f62b2345f463695ef0f8f79830cd76b6e0332821 Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Sat, 13 Jan 2024 10:35:22 +0700
Subject: Refactor src migrate folder

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

(limited to 'src-migrate/modules/product-promo/components/Item.tsx')

diff --git a/src-migrate/modules/product-promo/components/Item.tsx b/src-migrate/modules/product-promo/components/Item.tsx
index 15ca4878..6c5a14ce 100644
--- a/src-migrate/modules/product-promo/components/Item.tsx
+++ b/src-migrate/modules/product-promo/components/Item.tsx
@@ -3,7 +3,7 @@ import style from '../styles/item.module.css'
 import React from 'react'
 import Image from 'next/image'
 
-import { IProductVariantPromo } from '~/common/types/promotion'
+import { IProductVariantPromo } from '~/types/promotion'
 
 type Props = {
   variant: IProductVariantPromo,
-- 
cgit v1.2.3


From d9dafa74857959974e9d379dc1a3abfbaf2af83d Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Mon, 15 Jan 2024 15:13:20 +0700
Subject: Update improve product detail performance

---
 src-migrate/modules/product-promo/components/Item.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src-migrate/modules/product-promo/components/Item.tsx')

diff --git a/src-migrate/modules/product-promo/components/Item.tsx b/src-migrate/modules/product-promo/components/Item.tsx
index 6c5a14ce..8012c17e 100644
--- a/src-migrate/modules/product-promo/components/Item.tsx
+++ b/src-migrate/modules/product-promo/components/Item.tsx
@@ -1,7 +1,7 @@
 import style from '../styles/item.module.css'
 
 import React from 'react'
-import Image from 'next/image'
+import Image from '~/components/ui/image'
 
 import { IProductVariantPromo } from '~/types/promotion'
 
@@ -17,7 +17,7 @@ const ProductPromoItem = ({
   return (
     <div className={style.item}>
       <div className={style.image}>
-        <Image src={variant.image} alt={variant.display_name} width={120} height={120} quality={100} />
+        <Image src={variant.image || '/images/noimage.jpeg'} alt={variant.display_name} width={120} height={120} quality={100} />
         <div className={style.quantity}>
           {variant.qty} pcs {isFree ? '(free)' : ''}
         </div>
-- 
cgit v1.2.3


From 0f78bc94e3b55a718e4ba620b02994afc866672c Mon Sep 17 00:00:00 2001
From: Rafi Zadanly <zadanlyr@gmail.com>
Date: Tue, 20 Feb 2024 11:37:15 +0700
Subject: Update promo item name tooltip

---
 src-migrate/modules/product-promo/components/Item.tsx | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

(limited to 'src-migrate/modules/product-promo/components/Item.tsx')

diff --git a/src-migrate/modules/product-promo/components/Item.tsx b/src-migrate/modules/product-promo/components/Item.tsx
index 8012c17e..b396160f 100644
--- a/src-migrate/modules/product-promo/components/Item.tsx
+++ b/src-migrate/modules/product-promo/components/Item.tsx
@@ -1,8 +1,8 @@
 import style from '../styles/item.module.css'
 
-import React from 'react'
-import Image from '~/components/ui/image'
+import { Tooltip } from '@chakra-ui/react'
 
+import Image from '~/components/ui/image'
 import { IProductVariantPromo } from '~/types/promotion'
 
 type Props = {
@@ -22,7 +22,11 @@ const ProductPromoItem = ({
           {variant.qty} pcs {isFree ? '(free)' : ''}
         </div>
       </div>
-      <div className={style.name}>{variant.name}</div>
+      <Tooltip label={variant.display_name} placement='top' fontSize='sm'>
+        <div className={style.name}>
+          {variant.name}
+        </div>
+      </Tooltip>
     </div>
   )
 }
-- 
cgit v1.2.3

