"use client"; import { useState } from "react"; import Image from "next/image"; import { X } from "lucide-react"; interface BentoGalleryProps { images: string[]; } export default function BentoGallery({ images }: BentoGalleryProps) { const [lightboxIndex, setLightboxIndex] = useState(null); const openLightbox = (index: number) => { setLightboxIndex(index); }; const closeLightbox = () => { setLightboxIndex(null); }; return ( <>
{/* Big Feature Image */} {images.length > 0 && (
openLightbox(0)} > Gallery Image 1
)} {/* Top Right */} {images.length > 1 && (
openLightbox(1)} > Gallery Image 2
)} {/* Middle Right 1 */} {images.length > 2 && (
openLightbox(2)} > Gallery Image 3
)} {/* Middle Right 2 */} {images.length > 3 && (
openLightbox(3)} > Gallery Image 4
)} {/* Bottom Row 1 */} {images.length > 4 && (
openLightbox(4)} > Gallery Image 5
)} {/* Bottom Row 2 */} {images.length > 5 && (
openLightbox(5)} > Gallery Image 6
)}
{/* Lightbox */} {lightboxIndex !== null && (
e.stopPropagation()}> Lightbox Image
)} ); }