import React, { Dispatch, ReactNode, SetStateAction } from 'react'; import { Box, IconButton } from '@mui/material'; import CloseIcon from '@mui/icons-material/Close'; interface OverlayProps { open: boolean; onClose: Dispatch>; children: ReactNode; } const Overlay: React.FC = ({ open, onClose, children }) => { return ( <> {open && ( onClose(false)} > onClose(false)} sx={{ position: 'absolute', top: 16, right: 16, color: 'white', zIndex: 1310, }} > e.stopPropagation()}>{children} )} ); }; export default Overlay;