import React, { useEffect } from 'react'; export default function Lightbox({ images, currentIndex, onClose, onNext, onPrev }) { useEffect(() => { const handleKeyDown = (e) => { if (e.key === 'Escape') { onClose(); } else if (e.key === 'ArrowRight') { onNext(); } else if (e.key === 'ArrowLeft') { onPrev(); } }; document.addEventListener('keydown', handleKeyDown); return () => { document.removeEventListener('keydown', handleKeyDown); }; }, [onClose, onNext, onPrev]); if (!images || images.length === 0) return null; return (