diff options
Diffstat (limited to 'src/lib/brand/components')
| -rw-r--r-- | src/lib/brand/components/Brand.jsx | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/lib/brand/components/Brand.jsx b/src/lib/brand/components/Brand.jsx index 6ebb8aa7..3c411969 100644 --- a/src/lib/brand/components/Brand.jsx +++ b/src/lib/brand/components/Brand.jsx @@ -1,5 +1,5 @@ import useBrand from '../hooks/useBrand' -import Image from '@/core/components/elements/Image/Image' +import Image from 'next/image' import { Swiper, SwiperSlide } from 'swiper/react' import { Pagination, Autoplay } from 'swiper' @@ -29,6 +29,15 @@ const Brand = ({ id }) => { <> <div> {brand.isLoading && <ImageSkeleton />} + {brand.data?.banners?.length == 0 && ( + <Image + src='/images/default-banner-brand.jpg' + alt='Brand - Indoteknik' + width={1024} + height={512} + className='w-full h-auto' + /> + )} {brand.data && ( <> <Swiper @@ -43,6 +52,8 @@ const Brand = ({ id }) => { <Image src={banner} alt={`Brand ${brand.data?.name} - Indoteknik`} + width={1024} + height={512} className='w-full h-auto' /> </SwiperSlide> @@ -55,6 +66,8 @@ const Brand = ({ id }) => { src={brand?.data?.logo} alt={brand?.data?.name} className='w-32 p-2 border borde-gray_r-6 rounded' + width={256} + height={128} /> )} {!brand?.data?.logo && ( @@ -69,10 +82,20 @@ const Brand = ({ id }) => { <Divider /> </> </MobileView> + <DesktopView> <div className='container mx-auto mt-10 mb-3'> <div className='min-h-[150px]'> {brand.isLoading && <ImageSkeleton />} + {brand.data?.banners?.length == 0 && ( + <Image + src='/images/default-banner-brand.jpg' + alt='Brand - Indoteknik' + width={1024} + height={512} + className='w-full h-auto' + /> + )} {brand.data && ( <> <Swiper @@ -87,6 +110,8 @@ const Brand = ({ id }) => { <Image src={banner} alt={`Brand ${brand.data?.name} - Indoteknik`} + width={1024} + height={512} className='w-full h-auto' /> </SwiperSlide> @@ -99,6 +124,8 @@ const Brand = ({ id }) => { src={brand?.data?.logo} alt={brand?.data?.name} className='w-32 p-2 border borde-gray_r-6 rounded' + width={1024} + height={512} /> )} {!brand?.data?.logo && ( |
