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' },
  { key: 'name', label: 'Название' },
  { key: 'type', label: 'Тип' },
];

const Home: React.FC = () => {
  const { data: products } = useProducts();

  return (
    <Paper>
      <DataTable title="Товары" items={products} fields={fields} />
    </Paper>
  );
};

export default Home;
