diff --git a/src/App.css b/src/Form.css similarity index 100% rename from src/App.css rename to src/Form.css diff --git a/src/App.jsx b/src/Form.jsx similarity index 93% rename from src/App.jsx rename to src/Form.jsx index 317d661..6971550 100644 --- a/src/App.jsx +++ b/src/Form.jsx @@ -1,5 +1,5 @@ import { useState, useEffect } from 'react'; -import './App.css'; +import './Form.css'; function App() { const [payerName, setPayerName] = useState(''); @@ -9,6 +9,7 @@ function App() { const [clientId, setClientId] = useState(''); const [payerBankAccount, setPayerBankAccount] = useState(''); const [amount, setAmount] = useState('0-00'); + const [payerAccounts, setPayerAccounts] = useState([]); const handleBlur = () => { console.log(amount); @@ -37,7 +38,6 @@ function App() { action: 'getClientInfo', }), }); - const data = await response.json(); setPayerName(data.fields[3].value); setPayerINN(data.fields[4].value); @@ -45,6 +45,7 @@ function App() { setPayerAddress(data.fields[7].value); setClientId(data.fields[1].value); setPayerBankAccount(data.fields[12].value); + setPayerAccounts(data.accounts); }; fetchUsingAsyncAwaitWithFetchApi(); @@ -73,7 +74,13 @@ function App() { onChange={(e) => setPayerBankAccount(e.target.value)} onBlur={handleBlur} > - + {payerAccounts.map((item, ind) => ( + + ))}