Overview
DoctorSoft+ provides a base Modal component and specialized modal variants for common use cases. All modals support theme integration, responsive design, and print optimization.Modal
Base modal component providing overlay, content area, and optional header/footer sections.Props
Controls modal visibility
Callback fired when user clicks backdrop or close button
Optional modal title displayed in header section
Modal content to display in scrollable body area
Optional action buttons displayed in footer section
Custom CSS classes for modal container (e.g., “max-w-2xl” for wider modals)
Usage
Structure
The modal is composed of these sections: Backdrop - Full-screen semi-transparent overlay (~/workspace/source/src/components/Modal.tsx:36-40)- Black background with 50% opacity
- Clicking backdrop triggers
onClose - Hidden when printing
- Rounded corners and shadow
- Theme-aware background and border colors
- Responsive width based on
classNameprop - Print-optimized (removes shadow, rounds, constraints)
- Displayed when
titleprop provided - Bottom border separation
- Hidden when printing
- Max height 90vh with vertical scroll
- Theme-aware text color
- Padding maintained when printing
- Displayed when
actionsprop provided - Top border separation
- Right-aligned content
- Hidden when printing
Print optimization
Modal includes special print styles:- Removes backdrop and decorative elements
- Expands to full width
- Removes max-height constraint
- Maintains content readability
AlertModal
Pre-styled modal for displaying alert messages with contextual colors and icons.Props
Controls modal visibility
Callback fired when user dismisses the alert
Alert severity level determining colors and icon
Alert title displayed in modal header
Alert message content
Alert types
Each type uses specific colors and icons (~/workspace/source/src/components/AlertModal.tsx:18-56):- Error
- Warning
- Info
- Success
Icon: XCircleColors: Red theme (Red-100 background, Red-600 text)Usage: Critical errors, failed operations, validation failures
Usage
Features
- Themed “Aceptar” button matching current theme
- Icon and message in colored container
- Consistent spacing and layout
- Accessible color contrast
AppointmentRescheduleModal
Specialized modal for confirming appointment rescheduling with dynamic status selection based on workflow rules.Props
Controls modal visibility
Callback fired when user cancels
Callback fired when user confirms, receives selected status ID
Original appointment date in YYYY-MM-DD format
Original appointment time in HH:MM format
New appointment date in YYYY-MM-DD format
New appointment time in HH:MM format
Patient’s full name for display
Appointment reason/motivo
Current appointment status ID for determining allowed transitions
Usage
Status workflow
The modal fetches allowed status transitions based on current status usingapi.appointments.getFilteredStatusOptions() (~/workspace/source/src/components/AppointmentRescheduleModal.tsx:52-74).
Default selection logic:
- Prefers “Reprogramada x Paciente” (ID: 9) or “Reprogramada x Médico” (ID: 10)
- Falls back to first allowed status
- Maintains current status if no transitions allowed
Display sections
Patient info panel (~/workspace/source/src/components/AppointmentRescheduleModal.tsx:135-151)- Patient name with User icon
- Appointment reason
- Highlighted with theme primary color
- Original date/time with Calendar icon
- New date/time with Clock icon (highlighted in primary color)
- Formatted in Spanish locale: “viernes 15 de marzo de 2024 a las 14:30”
- Radio button cards for each allowed status
- Shows status name, description, and usage notes
- Selected option highlighted with primary color
- Loading state while fetching options
- Error state if fetch fails
- Yellow alert box with AlertCircle icon
- Reminds user about workflow implications
Features
- Loads status options asynchronously on mount
- Intelligent default status selection
- Theme-integrated styling
- Spanish date formatting
- Loading and error states
- Accessible radio button selection