This document provides a comprehensive overview of all components and containers in the Fee-ver medical bill analysis application.
Purpose: Initial screen for uploading medical bills and consent management.
Features:
- PDF file upload via drag-and-drop or file picker
- File validation (PDF only, max 10MB)
- Terms of Service & Privacy Policy modal
- Consent checkbox for document processing
- Optional data contribution checkbox
- Compliance with RA 10173 (Data Privacy Act of 2012)
Props:
onComplete: (data: any) => void- Callback when upload is successful
Key States:
file: Selected fileconsentChecked: Required consent statuscontributeData: Optional data sharing consentshowTosModal: Terms modal visibilityerror: Error message display
Purpose: Payment method selection screen to determine analysis type.
Features:
- Two analysis options: Cash payment vs HMO/Insurance
- HMO provider selection dropdown
- Responsive card-based layout
- Supports major Philippine HMO providers (Cocolife, Intellicare, Maxicare, etc.)
Props:
onSelect: (type: 'v1' | 'v2', hmoProvider?: string) => void
Analysis Types:
v1: Basic analysis for cash paymentsv2: Enhanced analysis with HMO coverage details
Purpose: Loading screen with dynamic status messages during bill analysis.
Features:
- Animated spinner with rotating phrases
- 8 different loading messages
- Auto-rotating messages every 5 seconds
- Gradient background design
Messages Include:
- "Analyzing your medical bill..."
- "Checking for duplicate charges..."
- "Comparing against PhilHealth benchmarks..."
- "Identifying overcharged items..."
Purpose: Display comprehensive bill analysis results.
Features:
- Duplicate charge detection
- Benchmark comparison
- HMO coverage analysis (v2 only)
- Interactive tooltips
- Copy/share functionality
- Summary statistics
Props:
billData: any- Uploaded bill dataanalysisType: 'v1' | 'v2'- Analysis versiononComplete: () => void- Continue callbackonBack: () => void- Back navigation
Analysis Components:
- Duplicate Charges: Shows repeated items with total amounts
- Benchmark Issues: Compares charges against standard rates
- HMO Items: Coverage details and patient responsibility (v2 only)
- Summary: Total charges, flagged amounts, and percentages
Purpose: Generate dispute templates and correspondence tools.
Features:
- Professional email template generation
- Copy to clipboard functionality
- Download options
- Polite, structured dispute format
- Includes specific charge details and benchmark comparisons
Template Includes:
- Formal letterhead format
- Itemized charge discrepancies
- Professional language
- Request for clarification
- Contact information placeholders
- Purpose: Container component with consistent styling
- Variants: Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, CardAction
- Features: Rounded borders, shadow, responsive padding
- Purpose: Interactive button component
- Variants: Primary, secondary, destructive, ghost, outline
- Features: Hover states, disabled states, loading states
- Purpose: Status and notification messages
- Variants: Default, destructive
- Features: Icon support, dismissible options
- Purpose: Boolean input selection
- Features: Custom styling, controlled/uncontrolled modes
- Purpose: Text input fields
- Features: Validation states, placeholder support
- Purpose: Multi-line text input
- Features: Resizable, character limits
- Purpose: Dropdown selection
- Features: Search functionality, custom options
- Purpose: Form validation and structure
- Features: Error handling, field validation
- Purpose: Related button collections
- Features: Consistent spacing, visual grouping
- Purpose: Contextual help and information
- Features: Hover activation, positioning
- Purpose: Modal dialogs and overlays
- Features: Backdrop, keyboard navigation, focus management
- Purpose: Slide-out panels
- Features: Multiple positions, overlay support
- Purpose: Structured data presentation
- Features: Sorting, responsive design
- Purpose: Status indicators and labels
- Features: Color variants, size options
- Purpose: Progress indicators
- Features: Animated, customizable
- Purpose: Loading placeholders
- Features: Animated shimmer effect
- Purpose: Visual content division
- Features: Horizontal/vertical orientation
- Purpose: Loading indicators
- Features: Multiple sizes, color variants
- Purpose: Empty state displays
- Features: Customizable messages and actions
- Purpose: Application theme management
- Features: Dark/light mode support, system preference detection
- Purpose: Responsive breakpoint detection
- Returns: Boolean indicating mobile viewport
- Purpose: Toast notification management
- Features: Queue management, auto-dismiss, action buttons
- cn(): Class name utility for conditional styling
- clsx: Class composition utility
- Color Palette: Slate-based with blue accents
- Typography: Consistent font sizes and weights
- Spacing: 4px grid system
- Border Radius: Consistent rounded corners
- Shadows: Subtle depth indicators
- Local State: React useState for component-specific data
- Props Down: Data flow through component hierarchy
- Event Callbacks: Parent-child communication
- Keyboard Navigation: Full keyboard support
- Screen Readers: Proper ARIA labels and roles
- Focus Management: Logical tab order
- Color Contrast: WCAG compliance
- Mobile First: Progressive enhancement
- Breakpoints: Tailwind CSS responsive utilities
- Touch Targets: Minimum 44px touch areas
- Readable Text: Appropriate font sizes
components/
├── analysis-screen.tsx # Main analysis display
├── loader-screen.tsx # Loading states
├── reassessment-screen.tsx # Dispute generation
├── theme-provider.tsx # Theme context
├── triage-screen.tsx # Payment type selection
├── upload-screen.tsx # File upload and consent
└── ui/ # Reusable UI components
├── button.tsx
├── card.tsx
├── checkbox.tsx
├── input.tsx
└── [40+ other components]
- React: Core framework
- Next.js: Application framework
- Tailwind CSS: Styling system
- Lucide React: Icon library
- next-themes: Theme management
- Radix UI: Unstyled component primitives
import { Button } from "@/components/ui/button";
import { Card } from "@/components/ui/card";
function MyComponent() {
return (
<Card>
<Button onClick={() => console.log("clicked")}>Click me</Button>
</Card>
);
}import UploadScreen from "@/components/upload-screen";
import TriageScreen from "@/components/triage-screen";
function App() {
const [screen, setScreen] = useState("upload");
if (screen === "upload") {
return <UploadScreen onComplete={() => setScreen("triage")} />;
}
if (screen === "triage") {
return <TriageScreen onSelect={(type) => setScreen("analysis")} />;
}
}When adding new components:
- Follow the established naming conventions
- Include proper TypeScript interfaces
- Add accessibility attributes
- Implement responsive design
- Update this documentation
- Add usage examples
For UI components, extend the existing design system and maintain consistency with the current styling approach.