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
Jip Fr a25b3dee54 First two pages of register flow
Co-authored-by: William Oldham <github@binaryoverload.co.uk>
2023-11-17 14:45:13 +01:00

35 lines
1 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { useMemo } from "react";
import { genMnemonic } from "@/backend/accounts/crypto";
import { Button } from "@/components/Button";
import { Icon, Icons } from "@/components/Icon";
import {
LargeCard,
LargeCardButtons,
LargeCardText,
} from "@/components/layout/LargeCard";
import { PassphaseDisplay } from "@/components/PassphraseDisplay";
interface PassphraseGeneratePartProps {
onNext?: (mnemonic: string) => void;
}
export function PassphraseGeneratePart(props: PassphraseGeneratePartProps) {
const mnemonic = useMemo(() => genMnemonic(), []);
return (
<LargeCard>
<LargeCardText title="Your passphrase" icon={<Icon icon={Icons.USER} />}>
If you lose this, you&apos;re a silly goose and will be posted on the
wall of shame
</LargeCardText>
<PassphaseDisplay mnemonic={mnemonic} />
<LargeCardButtons>
<Button theme="purple" onClick={() => props.onNext?.(mnemonic)}>
NEXT!
</Button>
</LargeCardButtons>
</LargeCard>
);
}