import React, { useState, useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; import { FaUser, FaUserPlus, FaCalendarAlt, FaCalendarCheck } from 'react-icons/fa'; import './style/Inicio.css'; import { Link } from 'react-router-dom'; function Inicio() { const navigate = useNavigate(); const [pacientes, setPacientes] = useState([]); const [agendamentos, setAgendamentos] = useState([]); const totalPacientes = pacientes.length; const novosEsseMes = pacientes.filter(p => p.createdAt && new Date(p.createdAt).getMonth() === new Date().getMonth()).length; const hoje = new Date(); const agendamentosDoDia = agendamentos.filter( a => a.data && new Date(a.data).getDate() === hoje.getDate() ); const agendamentosHoje = agendamentosDoDia.length; return (
{agendamento.nomePaciente}
{new Date(agendamento.data).toLocaleTimeString()}
Nenhum agendamento para hoje