import React, {FC, FormEvent, PropsWithChildren, ReactNode} from "react" import ReactDOM from "react-dom" export const Modal: FC = ({children, show, closeModal, ...props}) => { const stopEvent = (event: FormEvent) => { event.stopPropagation() event.preventDefault() } return show &&
{children}
} interface ModalProps { children: ReactNode, show: boolean, closeModal: () => void } const Overlay: FC = ({children, ...props}) => { const app = document.getElementById('app') if (app) { return ReactDOM.createPortal( , app ) } } interface OverlayProps { children: ReactNode, onClick: () => void }