import { ArrowRightIcon, CancelIcon } from "@lume/icons"; import * as Dialog from "@radix-ui/react-dialog"; import { Link, useParams } from "@tanstack/react-router"; import { invoke } from "@tauri-apps/api/core"; import { useState } from "react"; import { toast } from "sonner"; export function BackupDialog() { // @ts-ignore, magic!!! const { account } = useParams({ strict: false }); const [key, setKey] = useState(null); const [passphase, setPassphase] = useState(""); const [loading, setLoading] = useState(false); const encryptKey = async () => { try { setLoading(true); const encrypted: string = await invoke("get_encrypted_key", { npub: account, password: passphase, }); if (encrypted) { setKey(encrypted); } setLoading(false); } catch (e) { setLoading(false); toast.error(String(e)); } }; return ( Esc

This is your account key

It's use for login to Lume or other Nostr clients. You will lost access to your account if you lose this key.

setPassphase(e.target.value)} className="h-11 w-full resize-none rounded-lg border-transparent bg-neutral-100 placeholder:text-neutral-600 focus:border-blue-500 focus:ring focus:ring-blue-100 dark:bg-neutral-900 dark:focus:ring-blue-900" />
{key ? (
) : null}
{!key ? ( ) : ( I've safely store my account key )}
); }