diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2024-06-07 17:08:09 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2024-06-07 17:08:09 +0700 |
| commit | c88d98f06a6301bad6dd6d2e58b4908d8562638c (patch) | |
| tree | 282633b855acf235fe1d0d78b67d8cd46e032c03 /src/lib/home | |
| parent | 6ac1792ee37e5a5a9438f61e708966c944b61914 (diff) | |
<iman> add promotion program
Diffstat (limited to 'src/lib/home')
| -rw-r--r-- | src/lib/home/components/PromotionProgram.jsx | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/lib/home/components/PromotionProgram.jsx b/src/lib/home/components/PromotionProgram.jsx new file mode 100644 index 00000000..461383a1 --- /dev/null +++ b/src/lib/home/components/PromotionProgram.jsx @@ -0,0 +1,31 @@ +import Link from '@/core/components/elements/Link/Link' +import Image from 'next/image' +import { bannerApi } from '@/api/bannerApi'; + +const { useQuery } = require('react-query') + +const BannerSection = () => { + const promotionProgram = useQuery('promotionProgram', bannerApi({ type: 'banner-promotion' })); + + return ( + promotionProgram.data && + promotionProgram.data?.length > 0 && ( + <div className='grid grid-cols-3 sm:grid-cols-3 gap-4 rounded rounded-md'> + {promotionProgram.data?.map((banner) => ( + <Link key={banner.id} href={banner.url}> + <Image + width={439} + height={150} + quality={100} + src={banner.image} + alt={banner.name} + className='h-auto w-full rounded' + /> + </Link> + ))} + </div> + ) + ) +} + +export default BannerSection |
