1
0
Fork 0
mirror of https://github.com/sussy-code/smov.git synced 2024-12-23 15:07:43 +01:00
smov/src/pages/parts/auth/PassphraseGeneratePart.tsx

21 lines
564 B
TypeScript
Raw Normal View History

2023-11-05 01:16:45 +01:00
import { useMemo } from "react";
import { genMnemonic } from "@/backend/accounts/crypto";
import { Button } from "@/components/Button";
interface PassphraseGeneratePartProps {
onNext?: (mnemonic: string) => void;
}
export function PassphraseGeneratePart(props: PassphraseGeneratePartProps) {
const mnemonic = useMemo(() => genMnemonic(), []);
return (
<div>
<p>Remeber the following passphrase:</p>
<p className="border rounded-xl p-2">{mnemonic}</p>
<Button onClick={() => props.onNext?.(mnemonic)}>Next</Button>
</div>
);
}