import type { PropsWithChildren, ReactNode } from 'react'; import { createPortal } from 'react-dom'; interface Props extends PropsWithChildren { title: ReactNode; onClose(): void; } export function Dialog({ title, onClose, children }: Props) { const dialog = (
event.stopPropagation()}>

{title}

{children}
); return createPortal(dialog, document.body); }