summaryrefslogtreecommitdiff
path: root/src/services/contractors/ContractorPanel.tsx
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2021-03-25 23:09:49 +0300
committereug-vs <eug-vs@keemail.me>2021-03-25 23:09:49 +0300
commit062f10a25d43b875d187cf582b2ecf96d075ec26 (patch)
treec6b43379325ba22a051827e6a461a8f8fed98402 /src/services/contractors/ContractorPanel.tsx
parent77ac1549e2ab5ac68a1a7464ada9be7e2a2aad92 (diff)
downloadcommercel-ui-062f10a25d43b875d187cf582b2ecf96d075ec26.tar.gz
refactor: move services to separate folder
Diffstat (limited to 'src/services/contractors/ContractorPanel.tsx')
-rw-r--r--src/services/contractors/ContractorPanel.tsx34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/services/contractors/ContractorPanel.tsx b/src/services/contractors/ContractorPanel.tsx
new file mode 100644
index 0000000..ce94c48
--- /dev/null
+++ b/src/services/contractors/ContractorPanel.tsx
@@ -0,0 +1,34 @@
+import React from 'react';
+import { useHistory } from 'react-router-dom';
+import Button from '../../components/Button';
+import { patch, baseURL } from '../../requests';
+import { PanelProps } from '../../containers/Service/ServiceContext';
+
+
+const ContractorPanel: React.FC<PanelProps> = ({ item, mutate }) => {
+ const history = useHistory();
+
+ return (
+ <div className="lg:m-4 p-4 flex flex-col lg:pl-16 lg:border-l">
+ <span className="text-lg mb-10">
+ Долг контрагента: <span className="font-bold">{item.debt}</span>
+ </span>
+ <div className="grid lg:grid-cols-2">
+ <Button route={`/waybills?contractorId=${item._id}`} variant="outlined">
+ Показать накладные
+ </Button>
+ <Button route={`/waybills/add?contractorId=${item._id}`}>
+ Новая накладная
+ </Button>
+ <Button route={`/transfers?contractorId=${item._id}`} variant="outlined">
+ Показать переводы
+ </Button>
+ <Button route={`/transfers/add?contractorId=${item._id}`}>
+ Новый перевод
+ </Button>
+ </div>
+ </div>
+ );
+};
+
+export default ContractorPanel;