import { useState } from 'react' import { ChevronLeft, ChevronRight, X } from 'lucide-react' export default function ImageGallery({ data, onUpdate }) { const [currentImage, setCurrentImage] = useState(0) const [showModal, setShowModal] = useState(false) const images = data?.images || [ { url: 'https://images.unsplash.com/photo-1541963463532-d68292c34b19', caption: 'Sample Image 1' }, { url: 'https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d', caption: 'Sample Image 2' }, ] const nextImage = () => { setCurrentImage((prev) => (prev + 1) % images.length) } const prevImage = () => { setCurrentImage((prev) => (prev - 1 + images.length) % images.length) } return (
{image.caption}
{images[currentImage].caption}