(null);
+ const openPatient = useCallback((id: number) => setPatientId(id), []);
+ return (
+
+ {children}
+ {patientId !== null && (
+ setPatientId(null)} />
+ )}
+
+ );
+};
+
+export default PatientDrawerProvider;
diff --git a/frontend/src/pages/Agenda.tsx b/frontend/src/pages/Agenda.tsx
index 6058c08..dd73e4d 100644
--- a/frontend/src/pages/Agenda.tsx
+++ b/frontend/src/pages/Agenda.tsx
@@ -1,7 +1,8 @@
import type { FC } from 'react';
import { useEffect, useState, useCallback, useRef } from 'react';
-import { Clock, CheckCircle, XCircle, CheckCheck, UserCheck, UserX, Plus, PackageCheck, Sparkles, RotateCcw, LayoutGrid, List, Rows3, CalendarRange, CalendarClock, ChevronLeft, ChevronRight, Ban, Trash2, Phone } from 'lucide-react';
+import { Clock, CheckCircle, XCircle, CheckCheck, UserCheck, UserX, Plus, PackageCheck, Sparkles, RotateCcw, LayoutGrid, List, Rows3, CalendarRange, CalendarClock, ChevronLeft, ChevronRight, Ban, Trash2, Phone, Cake } from 'lucide-react';
import Layout from '../components/Layout';
+import { usePatientDrawer } from '../components/PatientDrawer';
import {
Card,
Button,
@@ -44,6 +45,7 @@ const QUARTER_TIME_OPTIONS = (() => {
const Agenda: FC = () => {
const [searchParams] = useSearchParams();
const { user } = useAuth();
+ const { openPatient } = usePatientDrawer();
// Rol médico: agenda restringida a su propio hr.employee (filtro también en servidor)
const isMedico = user?.role === 'medico';
const medicoEmployeeId = isMedico && user?.employee_id ? user.employee_id : null;
@@ -202,6 +204,12 @@ const Agenda: FC = () => {
);
};
+ // Icono de cumpleaños: el paciente cumple años el día de la cita (viene del API)
+ const birthdayIcon = (apt: Appointment, size = 11) =>
+ apt.patient_birthday ? (
+
+ ) : null;
+
const confirmTitle = (apt: Appointment): string => {
if (['arrived', 'in_progress', 'done'].includes(apt.state)) return '2da confirmación: llegó a la clínica';
if (apt.phone_confirmed) {
@@ -1260,6 +1268,7 @@ const Agenda: FC = () => {
>
{confirmIndicator(apt)}
+ {apt.patient_birthday && {birthdayIcon(apt)}}
{apt.time} · {apt.patient}
{apt.service}
@@ -1366,6 +1375,7 @@ const Agenda: FC = () => {
>
{confirmIndicator(apt, 10)}
+ {apt.patient_birthday && {birthdayIcon(apt, 10)}}
{apt.time} · {firstName(apt.patient)}
@@ -1461,6 +1471,7 @@ const Agenda: FC = () => {
className={`mb-0.5 rounded border-l-2 px-1 py-0.5 text-[10px] leading-tight shadow-card cursor-pointer transition-shadow hover:shadow-soft ${aptCategoryBar(apt)} ${gridStateClass[apt.state] || 'bg-theme-bg text-theme-heading'}`}
>
{confirmIndicator(apt, 10)}
+ {apt.patient_birthday && {birthdayIcon(apt, 10)}}
{apt.time} {firstName(apt.patient)}
))
@@ -1496,7 +1507,17 @@ const Agenda: FC = () => {
{apt.time}
- {apt.patient} |
+
+
+ |
|