From 208b234320b6c42491a4e87a1c3db3abab9c1715 Mon Sep 17 00:00:00 2001
From: it-fixcomart <it@fixcomart.co.id>
Date: Fri, 21 Jun 2024 10:52:28 +0700
Subject: <iman> update all-promotion

---
 src-migrate/modules/promo/components/Hero.tsx | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

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

diff --git a/src-migrate/modules/promo/components/Hero.tsx b/src-migrate/modules/promo/components/Hero.tsx
index 5470b93b..d8bb0be4 100644
--- a/src-migrate/modules/promo/components/Hero.tsx
+++ b/src-migrate/modules/promo/components/Hero.tsx
@@ -3,26 +3,30 @@ import 'swiper/css';
 import Image from 'next/image';
 import { useEffect, useMemo } from 'react';
 import { useQuery } from 'react-query';
-import { Swiper, SwiperProps, SwiperSlide } from 'swiper/react';
+import { Swiper, SwiperProps, SwiperSlide }  from 'swiper/react';
 
 import { getBanner } from '~/services/banner';
 import style from '../styles/hero.module.css';
+import 'swiper/css/navigation';
+import  { Navigation, Pagination } from 'swiper';
 
 const swiperBanner: SwiperProps = {
+  modules:[Navigation, Pagination],
   autoplay: {
     delay: 6000,
     disableOnInteraction: false
   },
-  loop: false,
+  loop: true,
   className: 'h-[400px] w-full',
   slidesPerView: 1,
-  spaceBetween: 10
+  spaceBetween: 10,
+  navigation:true,
 }
 
 const Hero = () => {
   const bannerQuery = useQuery({
     queryKey: ['banner.all-promo'],
-    queryFn: () => getBanner({ type: 'all-promo' })
+    queryFn: () => getBanner({ type: 'banner-promotion' })
   })
 
   const banners = useMemo(() => bannerQuery.data || [], [bannerQuery.data]);
@@ -47,7 +51,7 @@ const Hero = () => {
           {banners.map((banner, index) => (
             <SwiperSlide key={index}>
               <Image
-                src='https://erp.indoteknik.com/api/image/x_banner.banner/x_banner_image/363'
+                src={banner.image}
                 alt={banner.name}
                 width={666}
                 height={450}
-- 
cgit v1.2.3

