import React, { useState, useEffect } from "react";

import Table from 'antd/lib/table';
import Column from "antd/lib/table/Column";
import Tag from "antd/lib/tag";

import Service from "../../utils/Service";


const columns = [
    {
        title: "Nome",
        dataIndex: "nome"
    }
];
const TabelaCategoria = () => {


    const [data, setData] = useState([]);
    const [ loading, setLoading ] = useState(false);


    useEffect(() => {
        Service.call({
            url: `categorias`,
            setData,
            setLoading,
            errorTitle: 'Tabela das Categorias',
            errorMessage: 'Houve uma falha ao carregar a tabela das categorias...'
        });
    }, [ ]);

        return <Table columns={columns} dataSource={data} />
};

export default TabelaCategoria;