diff --git a/src/components/PMRInterface.tsx b/src/components/PMRInterface.tsx
index dac3d73..5af11ed 100644
--- a/src/components/PMRInterface.tsx
+++ b/src/components/PMRInterface.tsx
@@ -2,6 +2,7 @@ import { useState } from 'react'
import type { ViewId } from '../types/pmr'
import { ClinicalSidebar } from './ClinicalSidebar'
import { PatientBanner } from './PatientBanner'
+import { SummaryView } from './views/SummaryView'
interface PMRInterfaceProps {
children?: React.ReactNode
@@ -26,6 +27,30 @@ export function PMRInterface({ children }: PMRInterfaceProps) {
setActiveView(view)
}
+ const handleNavigate = (view: ViewId, itemId?: string) => {
+ void itemId
+ setActiveView(view)
+ window.location.hash = view
+ }
+
+ const renderView = () => {
+ switch (activeView) {
+ case 'summary':
+ return
+ default:
+ return (
+
+
+ {activeView} View
+
+
+ Content for {activeView} will be implemented in a separate task.
+
+
+ )
+ }
+ }
+
return (
@@ -33,20 +58,10 @@ export function PMRInterface({ children }: PMRInterfaceProps) {
- {children ? (
- children
- ) : (
-
-
- {activeView} View
-
-
- Content for {activeView} will be implemented in a separate task.
-
-
- )}
+ {children || renderView()}
diff --git a/src/components/views/SummaryView.tsx b/src/components/views/SummaryView.tsx
new file mode 100644
index 0000000..b5ae5c7
--- /dev/null
+++ b/src/components/views/SummaryView.tsx
@@ -0,0 +1,376 @@
+import { useState, useEffect } from 'react'
+import { AlertTriangle, Check, ChevronRight } from 'lucide-react'
+import { patient } from '@/data/patient'
+import { consultations } from '@/data/consultations'
+import { problems } from '@/data/problems'
+import { medications } from '@/data/medications'
+import type { ViewId } from '@/types/pmr'
+
+interface SummaryViewProps {
+ onNavigate?: (view: ViewId, itemId?: string) => void
+}
+
+export function SummaryView({ onNavigate }: SummaryViewProps) {
+ const [alertDismissed, setAlertDismissed] = useState(false)
+ const [alertAnimating, setAlertAnimating] = useState(false)
+ const [alertVisible, setAlertVisible] = useState(false)
+
+ const prefersReducedMotion = typeof window !== 'undefined'
+ ? window.matchMedia('(prefers-reduced-motion: reduce)').matches
+ : false
+
+ useEffect(() => {
+ const timer = setTimeout(() => {
+ setAlertVisible(true)
+ }, prefersReducedMotion ? 0 : 300)
+ return () => clearTimeout(timer)
+ }, [prefersReducedMotion])
+
+ const handleDismissAlert = () => {
+ setAlertAnimating(true)
+ setTimeout(() => {
+ setAlertDismissed(true)
+ }, prefersReducedMotion ? 0 : 400)
+ }
+
+ const activeProblems = problems.filter(p => p.status === 'Active' || p.status === 'In Progress')
+ const topMedications = medications.filter(m => m.category === 'Active').slice(0, 5)
+ const lastConsultation = consultations[0]
+
+ return (
+
+ {!alertDismissed && (
+
+ )}
+
+
+
+ )
+}
+
+interface ClinicalAlertProps {
+ visible: boolean
+ animating: boolean
+ onDismiss: () => void
+ prefersReducedMotion: boolean
+}
+
+function ClinicalAlert({ visible, animating, onDismiss, prefersReducedMotion }: ClinicalAlertProps) {
+ const [showCheck, setShowCheck] = useState(false)
+
+ const handleClick = () => {
+ if (!prefersReducedMotion) {
+ setShowCheck(true)
+ setTimeout(onDismiss, 200)
+ } else {
+ onDismiss()
+ }
+ }
+
+ return (
+
+
+
+
+
+ ALERT: This patient has identified £14.6M in prescribing efficiency savings across Norfolk & Waveney ICS.
+
+
+
+
+
+ )
+}
+
+function DemographicsCard() {
+ return (
+
+
+
+ Patient Demographics
+
+
+
+
+
+
+
+ {patient.status}
+
+ }
+ />
+
+
+
+ GPhC{' '}
+ {patient.nhsNumber.replace(/ /g, '')}
+
+ }
+ />
+
+
+
+
+
+
+ )
+}
+
+interface DemographicsRowProps {
+ label: string
+ value: React.ReactNode
+}
+
+function DemographicsRow({ label, value }: DemographicsRowProps) {
+ return (
+
+
+ {label}:
+
+ {value}
+
+ )
+}
+
+interface ActiveProblemsCardProps {
+ problems: typeof problems
+ onNavigate?: (view: ViewId, itemId?: string) => void
+}
+
+function ActiveProblemsCard({ problems, onNavigate }: ActiveProblemsCardProps) {
+ return (
+
+
+
+ Active Problems
+
+
+
+ {problems.map((problem) => (
+
+ ))}
+
+
+ )
+}
+
+interface TrafficLightProps {
+ status: 'Active' | 'In Progress' | 'Resolved'
+}
+
+function TrafficLight({ status }: TrafficLightProps) {
+ const colors = {
+ 'Active': { bg: 'bg-green-500', label: 'Active' },
+ 'In Progress': { bg: 'bg-amber-500', label: 'In Progress' },
+ 'Resolved': { bg: 'bg-green-500', label: 'Resolved' },
+ }
+ const color = colors[status]
+
+ return (
+
+
+
+ )
+}
+
+interface QuickMedsCardProps {
+ medications: typeof medications
+ onNavigate?: (view: ViewId) => void
+}
+
+function QuickMedsCard({ medications, onNavigate }: QuickMedsCardProps) {
+ return (
+
+
+
+ Current Medications (Quick View)
+
+
+
+
+
+
+ |
+ Drug
+ |
+
+ Dose
+ |
+
+ Freq
+ |
+
+ Status
+ |
+
+
+
+ {medications.map((med, index) => (
+
+ |
+ {med.name}
+ |
+
+ {med.dose}%
+ |
+
+ {med.frequency}
+ |
+
+
+
+ {med.status}
+
+ |
+
+ ))}
+
+
+
+
+
+
+
+ )
+}
+
+interface LastConsultationCardProps {
+ consultation: typeof consultations[0]
+ onNavigate?: (view: ViewId, itemId?: string) => void
+}
+
+function LastConsultationCard({ consultation, onNavigate }: LastConsultationCardProps) {
+ return (
+
+
+
+ Last Consultation
+
+
+
+
+
+
+ {consultation.date}
+ |
+ {consultation.organization}
+
+
+ {consultation.role}
+
+
+ {consultation.history}
+
+
+
+
+
+
+ )
+}