import React from "react"; import { TextInput, Button, Stack, Text, Alert, } from "@mantine/core"; import { IconKey, IconAlertCircle } from "@tabler/icons-react"; import { useTranslation } from "react-i18next"; interface MfaBackupCodeInputProps { value: string; onChange: (value: string) => void; error?: string; onSubmit: () => void; onCancel: () => void; isLoading?: boolean; } export function MfaBackupCodeInput({ value, onChange, error, onSubmit, onCancel, isLoading, }: MfaBackupCodeInputProps) { const { t } = useTranslation(); return ( } color="blue" variant="light"> {t( "Enter one of your backup codes. Each backup code can only be used once.", )} onChange(e.currentTarget.value.toUpperCase())} error={error} autoFocus data-autofocus maxLength={8} styles={{ input: { fontFamily: "monospace", letterSpacing: "0.1em", fontSize: "1rem", }, }} /> ); }