import React, { useState } from 'react'; import { QRCodeSVG } from 'qrcode.react'; import { Button } from '@/components/ui/Button'; interface MfaFormProps { isFirstSetup: boolean; qrUrl: string; isLoading: boolean; onVerify: (code: string) => void; onCancel: () => void; } export const MfaForm: React.FC = ({ isFirstSetup, qrUrl, isLoading, onVerify, onCancel }) => { const [code, setCode] = useState(''); const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); onVerify(code); }; return (
{isFirstSetup ? (

Configuration de la sécurité

Scannez ce QR Code avec Google Authenticator ou Authy.

) : (

Validation à double facteur

Saisissez le code généré par votre application d'authentification.

)}
setCode(e.target.value.replace(/\D/g, ''))} // Force les chiffres className="block w-full rounded-md border border-slate-300 py-3 text-center text-2xl tracking-[0.5em] text-slate-900 font-mono shadow-sm focus:border-blue-900 focus:ring-blue-900" />
); };