import { useEffect } from 'react' import './ImageLightbox.css' interface ImageLightboxProps { src: string onClose: () => void } export function ImageLightbox({ src, onClose }: ImageLightboxProps) { useEffect(() => { function handleKeyDown(e: KeyboardEvent) { if (e.key === 'Escape') onClose() } window.addEventListener('keydown', handleKeyDown) return () => window.removeEventListener('keydown', handleKeyDown) }, [onClose]) return (