'use client'; import React, { useState } from 'react'; import { RiImageLine } from '@remixicon/react'; import { cn } from '@/lib/utils'; import { Dialog, DialogContent, DialogTitle } from '@/components/ui/dialog'; interface ProductImage { url: string; altText?: string; } interface ProductDetailGalleryProps { images: ProductImage[]; } const ProductDetailGallery: React.FC = ({ images }) => { const [zoomedIndex, setZoomedIndex] = useState(null); if (images.length === 0) { return (
); } const zoomedImage = zoomedIndex !== null ? images[zoomedIndex] : null; return ( <>
{images.map((image, index) => ( ))}
{/* Zoom Lightbox */} !open && setZoomedIndex(null)} > Product image {zoomedImage && ( {zoomedImage.altText )} ); }; export default ProductDetailGallery;