"use client"; import { useEffect } from "react"; import { X, Download } from "lucide-react"; interface ImageLightboxProps { src: string; alt?: string; downloadHref?: string; onClose: () => void; } export function ImageLightbox({ src, alt, downloadHref, onClose }: ImageLightboxProps) { useEffect(() => { const handler = (e: KeyboardEvent) => { if (e.key === "Escape") onClose(); }; document.addEventListener("keydown", handler); return () => document.removeEventListener("keydown", handler); }, [onClose]); return (
{/* Controls */}
e.stopPropagation()}> {downloadHref && ( )}
{/* Image */} {alt e.stopPropagation()} />
); }