= ({
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);
}}
/>
);
};