summaryrefslogtreecommitdiff
path: root/src/components/ui/HeroBanner.jsx
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2024-10-02 10:40:49 +0700
committerit-fixcomart <it@fixcomart.co.id>2024-10-02 10:40:49 +0700
commitccb42e4cd91671d2dff6de30a16809756f83b35c (patch)
tree0689f322d01d36a1db60b54adb117839e5730362 /src/components/ui/HeroBanner.jsx
parent35c40c565730c80948a226d8de7478e6c3b86478 (diff)
parent2e6ce4c69cd15066fb6af35c2d7bf92d4316c9c9 (diff)
Merge branch 'new-release' into Feature/switch-account
Diffstat (limited to 'src/components/ui/HeroBanner.jsx')
-rw-r--r--src/components/ui/HeroBanner.jsx14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/components/ui/HeroBanner.jsx b/src/components/ui/HeroBanner.jsx
index 9a62465d..64838b85 100644
--- a/src/components/ui/HeroBanner.jsx
+++ b/src/components/ui/HeroBanner.jsx
@@ -39,16 +39,28 @@ const HeroBanner = () => {
pagination: { dynamicBullets: false, clickable: true },
};
+ const customLoader = ({ src }) => {
+ return src; // Loader yang mengembalikan URL gambar asli
+ };
+
const BannerComponent = useMemo(() => {
- return heroBanner.data?.map((banner, index) => (
+ if (!heroBanner.data) return null;
+
+ return heroBanner.data.map((banner, index) => (
<SwiperSlide key={index}>
<Link href={banner.url} className='w-full h-auto'>
<Image
+ loader={customLoader}
src={banner.image}
alt={banner.name}
width={1152}
height={768}
className='w-full h-auto'
+ priority={index === 0}
+ loading={index === 0 ? 'eager' : 'lazy'}
+ placeholder="blur"
+ blurDataURL="/images/indoteknik-placeholder.png"
+ sizes="(max-width: 768px) 100vw, 50vw"
/>
</Link>
</SwiperSlide>