import Address from '../components/Address' import { createAccountExternal } from '../utils/messaging' import { QrScanAddress } from '@polkadot/react-qr' import React, { useState } from 'react' import Header from '../components/Header' import { goTo } from '../utils/routing' interface QrAccount { isAddress: boolean content: string genesisHash: string name?: string } const ImportQr: React.FC = () => { const [account, setAccount] = useState() const onCreate = () => { if (account) { createAccountExternal( account.name || '', account.content, account.genesisHash ) .then(() => goTo('/')) .catch((error: Error) => console.error(error)) } } return ( <>
{!account && } {account && ( <>
)} ) } export default ImportQr