import { FunctionComponent } from 'preact'; import { AlertDialog, AlertDialogDescription, AlertDialogLabel } from '@node_modules/@reach/alert-dialog'; import { useRef } from '@node_modules/preact/hooks'; import { IconButton } from '@/components/IconButton'; export const ModalDialog: FunctionComponent = ({ children }) => { const ldRef = useRef(); return ( {/* sn-component is focusable by default, but doesn't stretch to child width resulting in a badly focused dialog. Utility classes are not available at the sn-component level, only below it. tabIndex -1 disables focus and enables it on the child component */}
{children}
); }; export const ModalDialogLabel: FunctionComponent<{ closeDialog: () => void; }> = ({ children, closeDialog }) => (
{children}
closeDialog()} />

); export const ModalDialogDescription: FunctionComponent = ({ children }) => ( {children} ); export const ModalDialogButtons: FunctionComponent = ({ children }) => ( <>
{children}
); export default ModalDialog;