"use client" import { useState, useEffect } from "react" import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import { Button } from "@/components/ui/button" import { RichTextEditor } from "./rich-text-editor" import { FormNavigation } from "./form-navigation" import { User, Activity, ClipboardList, Heart, FileText } from "lucide-react" export function ProgressNotesForm() { const [activeSection, setActiveSection] = useState("basic-info") const [formData, setFormData] = useState({ basicInfo: "", vitals: "", assessment: "", plan: "", notes: "", }) const sections = [ { id: "basic-info", label: "Basic Info", icon: }, { id: "vitals", label: "Vitals", icon: }, { id: "assessment", label: "Assessment", icon: }, { id: "plan", label: "Plan", icon: }, { id: "notes", label: "Notes", icon: }, ] useEffect(() => { const handleScroll = () => { const sectionElements = sections.map((section) => ({ id: section.id, element: document.getElementById(section.id), })) const currentSection = sectionElements.find(({ element }) => { if (!element) return false const rect = element.getBoundingClientRect() return rect.top <= 100 && rect.bottom >= 100 }) if (currentSection) { setActiveSection(currentSection.id) } } window.addEventListener("scroll", handleScroll) return () => window.removeEventListener("scroll", handleScroll) }, []) const updateFormData = (field: string, value: string) => { setFormData((prev) => ({ ...prev, [field]: value })) } return (
{/* Basic Info Section */} Basic Information
updateFormData("basicInfo", value)} placeholder="Patient's subjective complaints and symptoms..." fieldType="chief-complaints" showAutofill={true} autofillSource="Patient Interview" autofillTimestamp="2024-01-15, 10:30 AM" />
{/* Vitals Section */} Vital Signs & Objective Findings
updateFormData("vitals", value)} placeholder="Physical examination findings, lab results, imaging..." fieldType="assessment" rows={5} showAutofill={true} autofillSource="Nursing Station" autofillTimestamp="2024-01-15, 11:00 AM" />
{/* Assessment Section */} Assessment
updateFormData("assessment", value)} placeholder="Current clinical status, progress, complications..." fieldType="assessment" rows={6} />
{/* Plan Section */} Plan
updateFormData("plan", value)} placeholder="Treatment modifications, new orders, discharge planning..." fieldType="plan" rows={6} />
{/* Additional Notes Section */} Additional Notes
updateFormData("notes", value)} placeholder="Any additional observations, communications, or instructions..." fieldType="general" rows={4} />
{/* Form Actions */}
) }