diff options
-rw-r--r-- | src/services/accounts/AccountForm.tsx | 22 | ||||
-rw-r--r-- | src/services/accounts/index.ts | 2 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/services/accounts/AccountForm.tsx b/src/services/accounts/AccountForm.tsx new file mode 100644 index 0000000..fe834ed --- /dev/null +++ b/src/services/accounts/AccountForm.tsx @@ -0,0 +1,22 @@ +import React from 'react'; +import { Form } from 'formik'; +import Input from '../../components/Input'; +import Select from '../../components/Select'; + +const currencyOptions = [ + { key: 'BYN', label: 'BYN' }, + { key: 'USD', label: 'USD' }, + { key: 'EUR', label: 'EUR' }, +]; + +const AccountForm: React.FC = () => { + return ( + <Form id="form"> + <Input name="name" label="Название" /> + <Input name="code" label="Номер счёта" /> + <Select name="currency" label="Валюта" options={currencyOptions} /> + </Form> + ); +}; + +export default AccountForm; diff --git a/src/services/accounts/index.ts b/src/services/accounts/index.ts index 1936a9c..0200e15 100644 --- a/src/services/accounts/index.ts +++ b/src/services/accounts/index.ts @@ -1,5 +1,6 @@ import { ServiceParams } from '../../lib/ServiceContext'; import { Account } from '../types'; +import Form from './AccountForm'; const service: ServiceParams<Account> = { route: 'accounts', @@ -15,6 +16,7 @@ const service: ServiceParams<Account> = { name: '', balance: 0, }, + Form, }; export default service; |