From 2c106d1d3f6d59b10ad946e01e8bb3d0df587e40 Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Sun, 14 Mar 2021 10:10:16 +0300
Subject: refactor: create Service abstraction

---
 src/containers/Products.tsx | 32 --------------------------------
 1 file changed, 32 deletions(-)
 delete mode 100644 src/containers/Products.tsx

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

diff --git a/src/containers/Products.tsx b/src/containers/Products.tsx
deleted file mode 100644
index 0b6ea70..0000000
--- a/src/containers/Products.tsx
+++ /dev/null
@@ -1,32 +0,0 @@
-import React from 'react';
-import { useHistory } from 'react-router-dom';
-import Page from './Page';
-import ListTable from '../components/ListTable';
-import { useProducts } from '../hooks/useAPIClient';
-
-const fields = [
-  { key: 'name', label: 'Название' },
-  { key: 'price', label: 'Цена' },
-];
-
-const actions = [
-  { name: 'Добавить', route: 'products/add' },
-];
-
-const Products: React.FC = () => {
-  const history = useHistory();
-  const { data: products } = useProducts();
-
-  const handleRowClick = (index: number) => {
-    const product = products && products[index];
-    history.push(`/products/edit/${product?._id}`);
-  };
-
-  return (
-    <Page title="Товары" actions={actions}>
-      <ListTable items={products} fields={fields} handleRowClick={handleRowClick} />
-    </Page>
-  );
-};
-
-export default Products;
-- 
cgit v1.2.3

