diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2024-01-04 10:05:25 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2024-01-04 10:05:25 +0700 |
| commit | 67398e6f10d6f7729d8f1ace7005ef13d32c5ddd (patch) | |
| tree | 7d47ad6c1a7093e595e22bcecb40016a626162f6 /src-migrate/modules/product-promo/components/ModalContent.tsx | |
| parent | 89f32128f37d99b490de7590e2116a9cfd853f89 (diff) | |
Update promotion program feature
Diffstat (limited to 'src-migrate/modules/product-promo/components/ModalContent.tsx')
| -rw-r--r-- | src-migrate/modules/product-promo/components/ModalContent.tsx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src-migrate/modules/product-promo/components/ModalContent.tsx b/src-migrate/modules/product-promo/components/ModalContent.tsx index 45995af6..90cf79e7 100644 --- a/src-migrate/modules/product-promo/components/ModalContent.tsx +++ b/src-migrate/modules/product-promo/components/ModalContent.tsx @@ -1,6 +1,5 @@ import { useQuery } from "react-query" import { Skeleton } from "@chakra-ui/react" -import { motion } from "framer-motion" import { getVariantPromoByCategory } from "~/services/variant" @@ -22,10 +21,15 @@ const ProductPromoModalContent = () => { const promotions = promotionsQuery.data return ( - <Skeleton isLoaded={!promotionsQuery.isLoading} className='min-h-[60vh] grid grid-cols-1'> - {promotions?.data.map((promo) => ( - <ProductPromoCard key={promo.id} promotion={promo} /> - ))} + <Skeleton isLoaded={!promotionsQuery.isLoading} className='min-h-[70vh] max-h-[70vh]'> + <div className="grid grid-cols-1 gap-y-6 pb-6"> + {promotions?.data.map((promo) => ( + <ProductPromoCard key={promo.id} promotion={promo} /> + ))} + {promotions?.data.length === 0 && ( + <div className="py-10 rounded-lg h-fit text-center text-body-1 font-semibold text-gray-800 bg-gray-200">Belum ada promo pada kategori ini</div> + )} + </div> </Skeleton> ) } |
