diff --git a/app/epd/agenda/actions.ts b/app/epd/agenda/actions.ts index 6a97f07..fae5e6d 100644 --- a/app/epd/agenda/actions.ts +++ b/app/epd/agenda/actions.ts @@ -124,7 +124,7 @@ export async function createEncounter(params: CreateEncounterParams) { class_code: params.classCode, class_display: params.classDisplay, notes: params.notes, - status: 'planned', + status: 'planned' as const, }; console.log('[createEncounter] Insert data:', insertData); diff --git a/app/epd/agenda/components/agenda-toolbar.tsx b/app/epd/agenda/components/agenda-toolbar.tsx index a4a0c2d..0de2b41 100644 --- a/app/epd/agenda/components/agenda-toolbar.tsx +++ b/app/epd/agenda/components/agenda-toolbar.tsx @@ -21,10 +21,10 @@ interface AgendaToolbarProps { onNewAppointment: () => void; } -const VIEW_OPTIONS: { value: CalendarView; label: string }[] = [ +const VIEW_OPTIONS: { value: CalendarView; label: string; className?: string }[] = [ { value: 'timeGridDay', label: 'Dag' }, - { value: 'timeGridWeek', label: 'Week' }, - { value: 'timeGridWorkWeek', label: 'Werkweek' }, + { value: 'timeGridWeek', label: 'Week', className: 'hidden md:block' }, + { value: 'timeGridWorkWeek', label: 'Werkweek', className: 'hidden md:block' }, ]; export function AgendaToolbar({ @@ -60,7 +60,7 @@ export function AgendaToolbar({ }; return ( -
+
{/* Left: Title and Date */}

Agenda

@@ -104,11 +104,10 @@ export function AgendaToolbar({ @@ -116,9 +115,10 @@ export function AgendaToolbar({
{/* New Appointment Button */} -
diff --git a/app/epd/agenda/components/agenda-view.tsx b/app/epd/agenda/components/agenda-view.tsx index 46420a7..66251a4 100644 --- a/app/epd/agenda/components/agenda-view.tsx +++ b/app/epd/agenda/components/agenda-view.tsx @@ -10,6 +10,7 @@ import React, { useState, useCallback, useRef, useTransition, useEffect } from ' import dynamic from 'next/dynamic'; import { startOfWeek, endOfWeek, addDays, format } from 'date-fns'; import { toast } from '@/hooks/use-toast'; +import { useMediaQuery } from '@/hooks/use-media-query'; // Lazy load FullCalendar component (~150KB+ savings) const AgendaCalendar = dynamic( @@ -62,6 +63,14 @@ export function AgendaView({ initialEvents, initialDate, highlightEncounterId }: const [pendingReschedule, setPendingReschedule] = useState(null); const [isRescheduling, setIsRescheduling] = useState(false); + // Auto-switch to day view on mobile + const isMobile = useMediaQuery('(max-width: 767px)'); + useEffect(() => { + if (isMobile) { + setCurrentView('timeGridDay'); + } + }, [isMobile]); + const calendarRef = useRef<{ getApi: () => { prev: () => void; next: () => void; today: () => void; changeView: (view: string) => void; getDate: () => Date } } | null>(null); // Auto-open appointment modal when navigating from a report @@ -118,7 +127,7 @@ export function AgendaView({ initialEvents, initialDate, highlightEncounterId }: // Handle date range change from calendar const handleDateChange = useCallback((start: Date, end: Date) => { - setCurrentDate((prev) => + setCurrentDate((prev) => prev.toDateString() === start.toDateString() ? prev : start ); fetchEvents(start, end); @@ -246,7 +255,7 @@ export function AgendaView({ initialEvents, initialDate, highlightEncounterId }:
{/* Mini calendar sidebar */} -
+
id.system === 'http://fhir.nl/fhir/NamingSystem/bsn' || - id.system?.includes('bsn') || - id.type?.coding?.[0]?.code === 'BSN' + id.system?.includes('bsn') || + id.type?.coding?.[0]?.code === 'BSN' ); const bsn = bsnIdentifier?.value; // Extract last modified const lastModified = patient.meta?.lastUpdated ? new Date(patient.meta.lastUpdated).toLocaleString('nl-NL', { - day: '2-digit', - month: '2-digit', - year: 'numeric', - hour: '2-digit', - minute: '2-digit', - }) + day: '2-digit', + month: '2-digit', + year: 'numeric', + hour: '2-digit', + minute: '2-digit', + }) : null; // Check if John Doe @@ -141,7 +141,7 @@ export const EPDHeader = memo(function EPDHeader({ className = "" }: EPDHeaderPr
{/* Patient Details */} -
+
{birthDate && Geb: {birthDate}} {bsn && BSN: {bsn}} ID: {patient.id} @@ -184,7 +184,7 @@ export const EPDHeader = memo(function EPDHeader({ className = "" }: EPDHeaderPr
diff --git a/app/epd/patients/page.tsx b/app/epd/patients/page.tsx index a883a8b..fa8be45 100644 --- a/app/epd/patients/page.tsx +++ b/app/epd/patients/page.tsx @@ -32,10 +32,10 @@ export default async function PatientsPage({
- Nieuwe patiënt + Nieuwe patiënt
diff --git a/app/epd/verpleegrapportage/rapportage/components/rapportage-workspace.tsx b/app/epd/verpleegrapportage/rapportage/components/rapportage-workspace.tsx index 6200c47..c23ae99 100644 --- a/app/epd/verpleegrapportage/rapportage/components/rapportage-workspace.tsx +++ b/app/epd/verpleegrapportage/rapportage/components/rapportage-workspace.tsx @@ -172,9 +172,9 @@ export function RapportageWorkspace({ patients }: RapportageWorkspaceProps) { const groupedLogs = groupLogsByDayAndPart(logs); return ( -
+
{/* Sidebar - Patiënten */} -