import React, { FC, HTMLAttributes } from 'react'; import Grid from '@material-ui/core/Grid'; import { JsonEditor } from '../../../atoms/JsonEditor'; import TextField from '@material-ui/core/TextField'; import { LinkedDataIdentifier } from '../../../atoms/LinkedDataIdentifier'; export interface Props extends HTMLAttributes { setDialogState: any; passwordToKey: any; seedToId: any; } export const ImportDialogContent: FC = ({ seedToId, passwordToKey, setDialogState, }: any) => { const [seedId, setSeedId] = React.useState(''); const [editor, setEditorValue] = React.useState(''); const handlePasswordChange = async (event: any) => { const password = event.target.value; const seed = await passwordToKey(password); let seedId = await seedToId(seed); setSeedId(seedId); setDialogState({ seedId, seed: Buffer.from(seed).toString('hex'), password: password, }); }; const handleEditorChange = (value: any) => { setEditorValue(value); setDialogState({ editor: value, }); }; return (
{ handlePasswordChange(event); }} />
); };