import { useCopy } from "~/hooks/use-copy"; import { useViewer } from "~/hooks/use-viewer"; import { buttonClass } from "~/ui/Button"; import { Callout } from "~/ui/Callout"; function downloadText(filename: string, text: string): void { const url = URL.createObjectURL(new Blob([text], { type: "text/plain;charset=utf-8" })); const link = document.createElement("a"); link.href = url; link.download = filename; link.click(); URL.revokeObjectURL(url); } export function RecoveryCodes({ codes }: { codes: string[] }) { const viewer = useViewer(); const { copied, copy } = useCopy(); const text = `${codes.join("\n")}\n`; const filename = `gitfor-${viewer?.name ?? "account"}-backup-codes.txt`; return (

Save these recovery codes somewhere safe. Each works once, and they won't be shown again.

); }