// In this example, MfaModal would implement the MFA verification flow using
// useInitiateMfaVerification and useSubmitMfaVerification hooks
function App() {
const [showMfaModal, setShowMfaModal] = useState(false);
const [mfaMethods, setMfaMethods] = useState<MfaMethod[]>([]);
const { cancelMfaVerification } = useCancelMfaVerification();
useRegisterMfaListener(({ methods }) => {
setMfaMethods(methods);
setShowMfaModal(true);
});
const handleClose = () => {
cancelMfaVerification();
setShowMfaModal(false);
};
return (
<>
<YourApp />
<MfaModal
methods={mfaMethods}
isOpen={showMfaModal}
onClose={handleClose}
/>
</>
);
}