diff options
Diffstat (limited to 'src/services/products')
-rw-r--r-- | src/services/products/ProductForm.tsx | 15 | ||||
-rw-r--r-- | src/services/products/index.ts | 20 |
2 files changed, 35 insertions, 0 deletions
diff --git a/src/services/products/ProductForm.tsx b/src/services/products/ProductForm.tsx new file mode 100644 index 0000000..62f0e70 --- /dev/null +++ b/src/services/products/ProductForm.tsx @@ -0,0 +1,15 @@ +import React from 'react'; +import { Form } from 'formik'; +import Input from '../../components/Input'; + + +const ProductForm: React.FC = () => { + return ( + <Form id="form"> + <Input name="name" label="Название" /> + <Input name="price" type="number" label="Цена" /> + </Form> + ); +}; + +export default ProductForm; diff --git a/src/services/products/index.ts b/src/services/products/index.ts new file mode 100644 index 0000000..7e1509a --- /dev/null +++ b/src/services/products/index.ts @@ -0,0 +1,20 @@ +import Form from './ProductForm'; + +const service = { + route: 'products', + name: 'Товары', + nameSingular: 'Товар', + tableFields: [ + { key: 'name', label: 'Название' }, + { key: 'price', label: 'Цена' }, + { key: 'quantity', label: 'На складе' }, + ], + default: { + name: '', + price: '', + quantity: 0, + }, + Form, +}; + +export default service; |