import * as React from 'react'; import { useState } from 'react'; import { useTomo } from '../../src'; export default function TradePassword() { const { onSendEmailCode, onVerifyEmailCode } = useTomo(); const [email, setEmail] = useState(''); const sendBindEmailCode = async () => { if (!email) return alert('Please input email'); const res = await onSendEmailCode({ email }); alert(JSON.stringify(res)); }; const verifyBindEmailCode = async () => { if (!email) return alert('Please input email'); const code = prompt('Please input code'); if (!code) return alert('Please input code'); const password = prompt('Please input password'); if (!password) return alert('Please input password'); const res = await onVerifyEmailCode({ email, code, tradePassword: password, }); alert(JSON.stringify(res)); }; return (