import { ModalRoot, ModalContent, ModalOverlay, } from '../elements/ModalPrimitives' import { VStack, HStack } from '../elements/LayoutPrimitives' import { Button } from '../elements/Button' import { StyledText } from '../elements/StyledText' import { useCallback } from 'react' type ConfirmationModalProps = { message?: string richMessage?: React.ReactNode icon?: React.ReactNode acceptButtonLabel?: string cancelButtonLabel?: string onAccept: () => void onOpenChange: (open: boolean) => void } export function ConfirmationModal(props: ConfirmationModalProps): JSX.Element { const safeOnOpenChange = useCallback( (open: boolean) => { props.onOpenChange(open) setTimeout(() => { document.body.style.removeProperty('pointer-events') }, 200) }, [props] ) return ( {props.icon ? props.icon : null} {props.richMessage ? ( props.richMessage ) : ( {props.message} )} ) }