import { Button, Card, ErrorState, Textarea } from '@/components/ui' import { t } from '@/lib/i18n' export function RecoveryWarning(): React.ReactElement { return ( {t('account.create.recovery.warning.title')} {t('account.create.recovery.warning.part3')} ) } export function RecoveryPhraseDisplay({ recoveryPhrase, copied, onCopy, }: { recoveryPhrase: string[] copied: boolean onCopy: () => void }): React.ReactElement { const recoveryItems = buildRecoveryPhraseItems(recoveryPhrase) return ( {recoveryItems.map((item, index) => ( {index + 1}. {item.word} ))} { void onCopy() }} variant="secondary" size="small" className="w-full" > {copied ? t('account.create.recovery.copied') : t('account.create.recovery.copy')} ) } function buildRecoveryPhraseItems(recoveryPhrase: string[]): { key: string; word: string }[] { const counts = new Map() return recoveryPhrase.map((word) => { const nextCount = (counts.get(word) ?? 0) + 1 counts.set(word, nextCount) return { key: `${word}-${nextCount}`, word } }) } export function PublicKeyDisplay({ npub }: { npub: string }): React.ReactElement { return ( {t('account.create.publicKey')} {npub} ) } export function ImportKeyForm({ importKey, setImportKey, error, }: { importKey: string setImportKey: (key: string) => void error: string | null }): React.ReactElement { return ( <> setImportKey(e.target.value)} placeholder={t('account.create.importKey.placeholder')} className="font-mono text-sm text-neon-cyan bg-cyber-darker" rows={4} helperText={t('account.create.importKey.help')} /> {error && } > ) } export function ImportStepButtons({ loading, onImport, onBack }: { loading: boolean; onImport: () => void; onBack: () => void }): React.ReactElement { return ( {t('account.create.back')} { void onImport() }} disabled={loading} loading={loading} variant="primary" className="flex-1" > {loading ? t('import.loading') : t('import.button')} ) } function GenerateButton({ loading, onGenerate }: { loading: boolean; onGenerate: () => void }): React.ReactElement { return ( { void onGenerate() }} disabled={loading} loading={loading} variant="primary" size="large" className="w-full" > {loading ? t('account.create.importing') : t('account.create.generateButton')} ) } function ImportButton({ loading, onImport }: { loading: boolean; onImport: () => void }): React.ReactElement { return ( {t('account.create.importButton')} ) } function CancelButton({ onClose }: { onClose: () => void }): React.ReactElement { return ( {t('account.create.cancel')} ) } export function ChooseStepButtons({ loading, onGenerate, onImport, onClose, }: { loading: boolean onGenerate: () => void onImport: () => void onClose: () => void }): React.ReactElement { return ( ) }
{t('account.create.recovery.warning.title')}
{t('account.create.recovery.warning.part3')}
{t('account.create.publicKey')}
{npub}