From c03c6d1b5a7c57f92958cc7b7f25639a7ec11ad2 Mon Sep 17 00:00:00 2001 From: "Rodrigo B. de Sousa Martins" Date: Tue, 15 Jul 2025 21:37:02 -0300 Subject: [PATCH] dashboard: reimaginacao Signed-off-by: Rodrigo B. de Sousa Martins --- .../dashboard/CalendarioAtendimentos.tsx | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/components/dashboard/CalendarioAtendimentos.tsx b/src/components/dashboard/CalendarioAtendimentos.tsx index bfacc21..f1a6ea3 100644 --- a/src/components/dashboard/CalendarioAtendimentos.tsx +++ b/src/components/dashboard/CalendarioAtendimentos.tsx @@ -23,6 +23,9 @@ export const CalendarioAtendimentos: React.FC = () => { .sort((a, b) => b.data.localeCompare(a.data)) .slice(0, 10); + const [dataSelecionada, setDataSelecionada] = React.useState(hojeStr); + const eventosDoDia = eventos.filter(e => e.data === dataSelecionada); + if (isLoading) return
Carregando calendário...
; if (error) return
Erro ao buscar eventos
; @@ -35,18 +38,37 @@ export const CalendarioAtendimentos: React.FC = () => { {diasMes.map((dia) => { const dataStr = `${ano}-${mes}-${dia.toString().padStart(2, '0')}`; const eventosDia = eventos.filter(e => e.data === dataStr); + const selecionado = dataStr === dataSelecionada; return ( -
+
+ ); })} +
+

Eventos do dia {dataSelecionada.split('-').reverse().join('/')}

+
    + {eventosDoDia.length === 0 &&
  • Não existem eventos no dia selecionado.
  • } + {eventosDoDia.map((ev) => ( +
  • + {ev.tipo === 'Audiência' ? : } + {ev.tipo} + {ev.descricao} +
  • + ))} +
+

Próximos eventos