import { AlertCircle, X } from "lucide-react"; import type React from "react"; import { useCallback } from "react"; import { useEscapeToClose } from "../../hooks/useEscapeToClose"; import { useGallery } from "../../store/GalleryContext"; interface ErrorModalProps { message: string; } export const ErrorModal: React.FC = ({ message }) => { const { dispatch } = useGallery(); const handleClose = useCallback(() => { dispatch({ type: "CLOSE_MODAL" }); }, [dispatch]); useEscapeToClose({ onEscape: handleClose }); return (
e.stopPropagation()}>

Error

{message}
); };