import { useState, type FormEvent } from 'react'; import type { MfaChallengeProps } from './types.js'; /** * MFA code entry form (6-digit TOTP or recovery code). * Styled via CSS custom properties (inherits --bl-* from host app). */ export function MfaChallenge({ onSubmit, onUseRecovery, methods, isLoading = false, error, className, }: MfaChallengeProps) { const [code, setCode] = useState(''); function handleSubmit(e: FormEvent) { e.preventDefault(); onSubmit(code); } return (