From 64a537425a05a15ecfac3bf314735876dbbd8ed7 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 14 Mar 2021 02:32:09 +0300 Subject: feat: pull Products from api --- src/containers/Products.tsx | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'src/containers') 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 = () => ( - - - -); + return ( + + + + ); +}; export default Home; -- cgit v1.2.3