summaryrefslogtreecommitdiff
path: root/src/containers/Contractors.tsx
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2021-03-14 10:10:16 +0300
committereug-vs <eug-vs@keemail.me>2021-03-14 10:10:16 +0300
commit2c106d1d3f6d59b10ad946e01e8bb3d0df587e40 (patch)
treed0eff1bb17d55c34e52eb7c77d30631eaee87839 /src/containers/Contractors.tsx
parentde4811ce8d2e739901c047f39e9b4b7c18298e74 (diff)
downloadcommercel-ui-2c106d1d3f6d59b10ad946e01e8bb3d0df587e40.tar.gz
refactor: create Service abstraction
Diffstat (limited to 'src/containers/Contractors.tsx')
-rw-r--r--src/containers/Contractors.tsx33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/containers/Contractors.tsx b/src/containers/Contractors.tsx
deleted file mode 100644
index 5d589ea..0000000
--- a/src/containers/Contractors.tsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import React from 'react';
-import { useHistory } from 'react-router-dom';
-import Page from './Page';
-import ListTable from '../components/ListTable';
-import { useContractors } from '../hooks/useAPIClient';
-
-const fields = [
- { key: 'vatId', label: 'УНП' },
- { key: 'name', label: 'Название' },
- { key: 'debt', label: 'Долг' },
-];
-
-const actions = [
- { name: 'Добавить', route: 'contractors/add' },
-];
-
-const Contractors: React.FC = () => {
- const history = useHistory();
- const { data: contractors } = useContractors();
-
- const handleRowClick = (index: number) => {
- const contractor = contractors && contractors[index];
- history.push(`/contractors/edit/${contractor?._id}`);
- };
-
- return (
- <Page title="Контрагенты" actions={actions}>
- <ListTable items={contractors} fields={fields} handleRowClick={handleRowClick} />
- </Page>
- );
-};
-
-export default Contractors;