feat: implement SummaryView with Clinical Alert (Task 6)
- Create SummaryView component with clinical alert banner - Clinical alert: amber background, warning icon, acknowledge interaction - Alert animates in with spring effect, dismisses with checkmark → collapse - Demographics card: full width, two-column key-value layout - Active Problems card: 3 active/in-progress items with traffic lights - Current Medications Quick View: 4-column table showing top 5 skills - Last Consultation card: preview of most recent role - Add navigation handlers for view switching - Respects prefers-reduced-motion for all animations - Proper table semantics and accessibility attributes
This commit is contained in:
@@ -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 <SummaryView onNavigate={handleNavigate} />
|
||||
default:
|
||||
return (
|
||||
<div className="bg-white border border-gray-200 rounded p-6">
|
||||
<h1 className="font-inter font-semibold text-lg text-gray-900 capitalize">
|
||||
{activeView} View
|
||||
</h1>
|
||||
<p className="font-inter text-sm text-gray-500 mt-2">
|
||||
Content for {activeView} will be implemented in a separate task.
|
||||
</p>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-pmr-content">
|
||||
<PatientBanner />
|
||||
@@ -33,20 +58,10 @@ export function PMRInterface({ children }: PMRInterfaceProps) {
|
||||
<ClinicalSidebar activeView={activeView} onViewChange={handleViewChange} />
|
||||
<main
|
||||
role="main"
|
||||
aria-label={`${activeView} view`}
|
||||
className="flex-1 min-h-[calc(100vh-80px)] p-6"
|
||||
>
|
||||
{children ? (
|
||||
children
|
||||
) : (
|
||||
<div className="bg-white border border-gray-200 rounded p-6">
|
||||
<h1 className="font-inter font-semibold text-lg text-gray-900 capitalize">
|
||||
{activeView} View
|
||||
</h1>
|
||||
<p className="font-inter text-sm text-gray-500 mt-2">
|
||||
Content for {activeView} will be implemented in a separate task.
|
||||
</p>
|
||||
</div>
|
||||
)}
|
||||
{children || renderView()}
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user