import { createPortal } from "react-dom"; import { useId, useRef } from "react"; import { NavigationFocusScope } from "./navigation-focus"; import { CONSENT_ACCEPT_LABEL, CONSENT_BODY, CONSENT_DECLINE_LABEL, CONSENT_TITLE, } from "./local-sign-in"; /** * The plaintext-storage consent prompt. `role="alertdialog"` and visible * warning styling per issue #157; Escape, the backdrop, and "No, cancel * sign-in" all decline. There is no other dismissal that continues sign-in. */ export function LocalConsentDialog( { path, onDecision }: { path: string; onDecision: (accept: boolean) => void }, ) { let titleId = useId(); let bodyId = useId(); let decline = useRef(null); let dismiss = () => onDecision(false); return createPortal(
, document.body, ); }