summaryrefslogtreecommitdiff
path: root/src/containers
diff options
context:
space:
mode:
Diffstat (limited to 'src/containers')
-rw-r--r--src/containers/Products.tsx22
1 files changed, 9 insertions, 13 deletions
diff --git a/src/containers/Products.tsx b/src/containers/Products.tsx
index 9b4f507..8cd301a 100644
--- a/src/containers/Products.tsx
+++ b/src/containers/Products.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import Paper from '../components/Paper';
import DataTable from '../components/DataTable';
+import { useProducts } from '../hooks/useAPIClient';
const fields = [
{ key: '_id', label: 'ID' },
@@ -8,19 +9,14 @@ const fields = [
{ key: 'type', label: 'Тип' },
];
-const items = [
- { _id: 1, name: 'Товар 1', type: 'Кондиционер' },
- { _id: 2, name: 'Товар 2', type: 'Кондиционер' },
- { _id: 3, name: 'Товар 3', type: 'Кондиционер' },
- { _id: 4, name: 'Товар 4', type: 'Кондиционер' },
- { _id: 5, name: 'Товар 5', type: 'Кондиционер' },
- { _id: 6, name: 'Товар 6', type: 'Кондиционер' },
-];
+const Home: React.FC = () => {
+ const { data: products } = useProducts();
-const Home: React.FC = () => (
- <Paper>
- <DataTable title="Товары" items={items} fields={fields} />
- </Paper>
-);
+ return (
+ <Paper>
+ <DataTable title="Товары" items={products} fields={fields} />
+ </Paper>
+ );
+};
export default Home;