diff --git a/ui/src/containers/DashboardContainer/index.jsx b/ui/src/containers/DashboardContainer/index.jsx index 2ea2054..9dfb76f 100644 --- a/ui/src/containers/DashboardContainer/index.jsx +++ b/ui/src/containers/DashboardContainer/index.jsx @@ -1,27 +1,75 @@ -import { useState, useEffect, useRef } from "react"; +import React, { useState, useEffect, useImperativeHandle } from "react"; -import MyButton from "../../components/MyButton"; +import { Table } from 'antd'; + +import _service from '@netuno/service-client'; import "./index.less"; -function DashboardContainer() { - const [counter, setCounter] = useState(0); +const columns = [ + { + title: 'UID', + dataIndex: 'uid', + key: 'uid', + }, + { + title: 'Nome', + dataIndex: 'nome', + key: 'nome', + }, + { + title: 'CPF', + dataIndex: 'CPF', + key: 'CPF', + }, + { + title: 'RG', + dataIndex: 'RG', + key: 'RG', + }, + { + title: 'Data de Nascimento', + dataIndex: 'data de nascimento', + key: 'data de nascimento', + }, + { + title: 'Endereço', + dataIndex: 'endereço', + key: 'endereço', + }, + { + title: 'Telefone', + dataIndex: 'telefone', + key: 'telefone', + } +]; - const refButton = useRef(); +function DashboardContainer() { + const [pacientes, setPacientes] = useState([]); useEffect(() => { - $(refButton.current).fadeOut(250).fadeIn(250); - }, [counter]); + carregarPacientes(); + }, []); - const onClick = () => { - setCounter(counter + 1); + const carregarPacientes = () => { + setPacientes([]); + _service({ + url: "/services/pacientes", + success: (response) => { + setPacientes(response.json); + }, + fail: (e) => { + console.error("Serviço de pacientes falhou.", e); + message.error("Serviço de pacientes falhou.", e); + } + }); }; return ( -