import React, { useState } from 'react'; import { ScrollView, View } from 'react-native'; import { Button, TextInput } from 'react-native-paper'; import { addAccountFromHDPath } from '../utils'; import { Account } from '../types'; const HDPath = ({ updateAccounts, updateIndex, hideDialog, }: { updateIndex: (index: number) => void; updateAccounts: (account: Account) => void; hideDialog: () => void; }) => { const [path, setPath] = useState(''); const [isAccountCreating, setIsAccountCreating] = useState(false); const createFromHDPathHandler = async () => { setIsAccountCreating(true); const newAccount = await addAccountFromHDPath(path); setIsAccountCreating(false); if (newAccount) { updateAccounts(newAccount); updateIndex(newAccount.counterId); hideDialog(); } }; return ( setPath(text)} value={path} /> ); }; export default HDPath;