import { useEffect } from 'react';
import { X } from 'lucide-react';
interface ModalProps {
title: string;
onClose: () => void;
children: React.ReactNode;
/** Optional override for the max-width of the modal panel (default: max-w-md) */
maxWidth?: string;
}
/**
* Generic modal overlay with a header and close button.
* Closes on Escape key or backdrop click.
* Render form content (or any JSX) as children.
*
* @example
*