import { useState } from 'react'; import './blocks.css'; export interface ImageGalleryBlockProps { title?: string; subtitle?: string; images: Array<{ url: string; alt?: string; caption?: string; thumbnailUrl?: string; }>; columns?: 2 | 3 | 4; variant?: 'grid' | 'masonry' | 'carousel'; lightbox?: boolean; } export function ImageGalleryBlock({ title, subtitle, images, columns = 3, variant = 'grid', lightbox = false }: ImageGalleryBlockProps) { const [selectedImage, setSelectedImage] = useState(null); return (
{title &&

{title}

} {subtitle &&

{subtitle}

}
{images.map((image, index) => (
lightbox && setSelectedImage(index)} > {image.alt {image.caption && (

{image.caption}

)}
))}
{lightbox && selectedImage !== null && (
setSelectedImage(null)} > {images[selectedImage].alt
)}
); }