import React, { Fragment } from 'react'; import { CloseIcon } from './Icons'; interface ModalProps { isOpen: boolean; onClose: () => void; title: string; children: React.ReactNode; } const Modal: React.FC = ({ isOpen, onClose, title, children }) => { if (!isOpen) { return null; } return (
{/* Background overlay */} {/* This element is to trick the browser into centering the modal contents. */} {/* Modal panel */}
{children}
); }; export default Modal;