import { type HTMLAttributes } from 'react'; import type { CalendarEventStatus } from '../calendar'; import type { AppointmentDetailsChairLabel, AppointmentDetailsHistory, AppointmentDetailsNotesPreview, AppointmentDetailsOperatorLabel, AppointmentDetailsState, AppointmentDocumentKind } from './appointment-details-panel.types'; export interface AppointmentDetailsPanelProps extends Omit, 'children' | 'title' | 'onCopy'> { /** The read, or the shell state while there is none. Pair it with * `useAppointmentDetailsRead`, which keeps the latest selection. */ state: AppointmentDetailsState; /** Retry from the error shell and from a retryable refusal. Without it, * no Retry button. */ onRetry?: () => void; /** The appointment's patient id when the read carries no record: an id * without a record reads "Patient record not loaded", never "no * patient". Default `read.patient?.id`. */ patientId?: string; /** The operator's label, resolved by the host from * `appointment.operatorId`. Absent = no operator row. */ operator?: AppointmentDetailsOperatorLabel; /** The chair's label. Absent = no chair row. */ chair?: AppointmentDetailsChairLabel; /** ISO 4217 code for the money chips, the paid-online row and the * treatment prices. Default 'EUR'. */ currency?: string; /** The practice clock the patient's age is computed against. Default: * the real clock. */ now?: Date | string; /** Locale for dates, times and amounts. Default: the active language. */ locale?: string; /** Header title. Default "Appointment details". Ignored under `privacy`, * so a patient name can never reach the header. */ title?: string; /** Privacy mode: the identity is masked; the photo, contact fields, * chips, description, notes, the booker's contact, the plan name and * `whatsappUrl` are withheld. Time, operator, chair, status, treatments * and History stay. A display mask on top of the host's server-side * masking, never instead of it. */ privacy?: boolean; /** The grid's mask for this appointment; bullets without one. Read only * under `privacy`. */ privacyTitle?: string; /** The user's map-link setting (platform `showPatientAddressMapLink`). */ mapsLink?: boolean; /** The latest notes of this appointment's patient, and only theirs: set * `patientId` and notes for another patient show as loading. Without * it, no notes card. Pass it only when the appointment has a patient. */ notesPreview?: AppointmentDetailsNotesPreview; /** Open the host's Notes tool, at one note when a note was clicked. * Without it, the preview opens nothing. */ onOpenNotes?: (noteId?: string) => void; /** The appointment's history, read by the host once History opens. * Present = the user may read it, so the header offers History. Set its * `eventId`: entries for another occurrence show as loading. Wins over * `read.history`, the shortcut for a history sent with the read. */ history?: AppointmentDetailsHistory; /** History opened, from its button or the agent: start the host's read. * Called on every opening. */ onOpenHistory?: (eventId: string) => void; /** In History, say "What changed was not recorded." under an edit that * carries no detail. Off by default. */ noteUnrecordedEdits?: boolean; /** Withholds Edit, Move, Copy, Delete, the status change and the * description edit. Join, WhatsApp, Create task and the documents menu * are the host's to withhold. */ readOnly?: boolean; /** Save a new status. Reject with a translated Error: the control keeps * the old status and shows the message. Absent = status read-only. * Every handler's last argument is the event id of the read it acted * on: write to that appointment, never to "the current selection". */ onStatusChange?: (status: CalendarEventStatus, eventId: string) => Promise; /** The statuses this user may set, in any order; the menu keeps the * platform's. Default: all six. The current status is always shown, and * disabled when not allowed. With no status to move to (an empty list, * or the current one alone) the status is shown read-only. */ allowedStatuses?: readonly CalendarEventStatus[]; /** Save a new description from the pencil's sub-view. Reject with a * translated Error: the sub-view stays open and shows it. Absent = the * description is read-only. */ onDescriptionChange?: (description: string, eventId: string) => Promise; /** Hand over to the host's editor. */ onEdit?: (eventId: string) => void; /** Arm the host's move placement. */ onMove?: (eventId: string) => void; /** Start the host's copy. With treatments on the read, a menu asks for * the appointment alone or with its treatments. */ onCopy?: (withTreatments: boolean, eventId: string) => void; /** Start the host's delete. The host owns the confirmation, the series * scope and any care-plan clean-up. */ onDelete?: (eventId: string) => void; /** Join the video visit. The host keeps the session code. */ onJoinTelehealth?: (eventId: string) => void; /** The host's WhatsApp bridge. Wins over `whatsappUrl` as the one * button. Withhold it yourself where the user may not message the * patient. */ onWhatsApp?: (eventId: string) => void; /** A host-composed WhatsApp link, opened in a new tab. Withheld under * `privacy`, because it carries the patient's number. */ whatsappUrl?: string; /** Server-built link to the task page, opened in the same tab. */ createTaskUrl?: string; /** The create-document kinds the user may use, and what each does. The * menu keeps the platform's order. */ documents?: { kinds: readonly AppointmentDocumentKind[]; onCreate: (kind: AppointmentDocumentKind, eventId: string) => void; }; } /** Curated agent handle: ids and enums only, never patient data. */ export interface AppointmentDetailsPanelHandle { /** The occurrence on screen or being read, or the one a failed or * refused read was for when the state says; null otherwise. */ getEventId: () => string | null; getLoadStatus: () => AppointmentDetailsState['status']; /** The status as last saved here or read; null for none, or no read. */ getAppointmentStatus: () => CalendarEventStatus | null; /** The statuses `setAppointmentStatus` accepts now; [] when the status * cannot be changed. */ getAllowedStatuses: () => CalendarEventStatus[]; /** The footer's `data-action` values, in footer order. */ getOfferedActions: () => string[]; isHistoryOpen: () => boolean; isPrivacy: () => boolean; /** Throws when History is not offered. */ openHistory: () => void; closeHistory: () => void; /** The footer control's own path: it shows the saving state and any * refusal. Rejects when the change is not offered, not allowed, or a * save is in flight, including one started in the same tick. */ setAppointmentStatus: (status: CalendarEventStatus) => Promise; /** Throws when no Retry is offered. */ retry: () => void; } /** * The appointment details panel: a props-driven rail panel for one * occurrence. Mount it as a `fill` tool in ControlRoomRail, which adds its * favourite and close controls to the panel's own header. */ export declare const AppointmentDetailsPanel: import("react").ForwardRefExoticComponent>; //# sourceMappingURL=appointment-details-panel.d.ts.map