/** * @deprecated */ import React, { useState } from 'react'; import Alert from './alert'; function WalletPrivatekey(props: any) { const role = props.role; const [privateKey, setPrivatekey] = useState(''); const handleError = () => { Alert('error', 'Wallet Decrypt Error', 'Please ensure there are no additional spaces at the end.'); } const handlePrivatekey = (e: any) => { setPrivatekey(e.target.value) } const unlockWallet = async () => { console.log("unlock by privatekey"); if (privateKey !== "") { // const walletAddress = await Account.addWalletByPrivatekey(privateKey); // if (walletAddress !== "error") { // console.log("wallet add success: %o", walletAddress); // // show loading state // props.onWalletLoadingCallback(); // // redirect to dashboard // props.onSuccessCallback(); // } else { // handleError(); // } } } return (