From 8e011b65f346386abe26afcce737dd59c5865988 Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Sun, 14 Mar 2021 12:08:32 +0300
Subject: feat: add Waybills

---
 src/containers/WaybillForm.tsx | 33 +++++++++++++++++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 src/containers/WaybillForm.tsx

(limited to 'src/containers/WaybillForm.tsx')

diff --git a/src/containers/WaybillForm.tsx b/src/containers/WaybillForm.tsx
new file mode 100644
index 0000000..e4d7d82
--- /dev/null
+++ b/src/containers/WaybillForm.tsx
@@ -0,0 +1,33 @@
+import React from 'react';
+import { Form, Field } from 'formik';
+import Input from '../components/Input';
+import hooks from '../hooks/useAPIClient';
+
+const WaybillForm: React.FC = () => {
+  const { data: contractors } = hooks.contractors.useList();
+  const { data: products } = hooks.products.useList();
+
+  return (
+    <Form id="form">
+      <div className="max-w-lg">
+        <Field name="operation" as="select">
+          <option value="in">Приход</option>
+          <option value="out">Расход</option>
+        </Field>
+        <Field name="contractorId" as="select">
+          {contractors?.map(contractor => (
+            <option value={contractor._id}>{contractor.name}</option>
+          ))}
+        </Field>
+        <Field name="productId" as="select">
+          {products?.map(product => (
+            <option value={product._id}>{product.name}</option>
+          ))}
+        </Field>
+        <Input name="quantity" type="number" label="Количество" />
+      </div>
+    </Form>
+  );
+};
+
+export default WaybillForm;
-- 
cgit v1.2.3

