'use client'; import React from 'react'; import { AppointmentTypeCode, LocationClassCode, CalendarEvent } from '@/app/epd/agenda/types'; import { AgendaListView } from './agenda-list-view'; import { AgendaCreateForm } from './agenda-create-form'; import { AgendaCancelView } from './agenda-cancel-view'; import { AgendaRescheduleForm } from './agenda-reschedule-form'; import { motion, AnimatePresence } from 'framer-motion'; export interface AgendaBlockProps { mode: 'list' | 'create' | 'cancel' | 'reschedule'; appointments?: CalendarEvent[]; dateRange?: { start: Date; end: Date; label: string }; prefillData?: { patient?: { id: string; name: string }; datetime?: { date: Date; time: string }; type?: AppointmentTypeCode; location?: LocationClassCode; notes?: string; identifier?: { encounterId?: string; encounter?: CalendarEvent }; newDatetime?: { date: Date; time: string }; }; disambiguationOptions?: CalendarEvent[]; onClose?: () => void; } export function AgendaBlock({ mode, appointments, dateRange, prefillData, disambiguationOptions, onClose, }: AgendaBlockProps) { const renderContent = () => { switch (mode) { case 'list': return ( console.log('Cancel requested', evt)} onViewDetails={(evt) => window.location.href = `/epd/agenda?focus=${evt.id}`} /> ); case 'create': return ; case 'cancel': return ( ); case 'reschedule': return ; default: return
Unknown mode: {mode}
; } }; return ( {renderContent()} ); }