diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2024-01-13 10:35:22 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2024-01-13 10:35:22 +0700 |
| commit | f62b2345f463695ef0f8f79830cd76b6e0332821 (patch) | |
| tree | c06ff12a8312e3a02b0203f588db0f4da044c911 /src-migrate/modules/product-detail/components/Image.tsx | |
| parent | ee0b5893ac039ab05fe8247647364a923d707da3 (diff) | |
Refactor src migrate folder
Diffstat (limited to 'src-migrate/modules/product-detail/components/Image.tsx')
| -rw-r--r-- | src-migrate/modules/product-detail/components/Image.tsx | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src-migrate/modules/product-detail/components/Image.tsx b/src-migrate/modules/product-detail/components/Image.tsx new file mode 100644 index 00000000..361580ea --- /dev/null +++ b/src-migrate/modules/product-detail/components/Image.tsx @@ -0,0 +1,37 @@ +import React from 'react' +import { InfoIcon } from 'lucide-react' +import { Tooltip } from '@chakra-ui/react' + +import { IProductDetail } from '~/types/product' +import ImageUI from '~/components/ui/image' + +type Props = { + product: IProductDetail +} + +const Image = ({ product }: Props) => { + return ( + <div className='h-[340px] border border-gray-200 rounded-lg p-2 relative'> + <ImageUI + src={product.image || '/images/noimage.jpeg'} + alt={product.name} + width={512} + height={512} + className='object-contain object-center h-full' + classNames={{ wrapper: 'h-full' }} + /> + <div className='absolute hidden md:block top-4 right-4'> + <Tooltip + placement='bottom-end' + label='Gambar atau foto berperan sebagai ilustrasi produk. Kadang tidak sesuai dengan kondisi terbaru dengan berbagai perubahan dan perbaikan. Hubungi admin kami untuk informasi yang lebih baik perihal gambar.' + > + <div className="text-gray-600"> + <InfoIcon size={20} /> + </div> + </Tooltip> + </div> + </div> + ) +} + +export default Image
\ No newline at end of file |
