import { useState } from 'react'; import { Check, Copy } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { copyText } from '@/lib/utils'; export function TotpRecoveryCodes({ codes, onConfirm, }: { codes: string[]; onConfirm: () => void; }) { const [copied, setCopied] = useState(false); const [copyError, setCopyError] = useState(false); const [saved, setSaved] = useState(false); return (

每个恢复码只能用一次。请立刻抄写或保存到离线位置,关闭后将无法再查看。

    {codes.map((code) => (
  1. e.currentTarget.select()} />
  2. ))}
{copyError && (

复制失败,请长按上面的码手动拷贝。

)}
); }