'use client'; import { Card, CardContent } from '@/components/ui/card'; import { cn } from '@/lib/utils'; import { type LifeDomain, type LifeDomainScore, LIFE_DOMAIN_META } from '@/lib/types/leefgebieden'; import { Stethoscope, MessageSquareQuote } from 'lucide-react'; interface Condition { id: string; category: string; code_display: string; severity_code: string | null; severity_display: string | null; } interface ContextHeaderProps { condition: Condition | null; hulpvraag: string | null; lifeDomainScores: LifeDomainScore[] | null; className?: string; } /** * Blok 1: Context Header * Read-only samenvatting van diagnose, hulpvraag en leefgebieden */ export function ContextHeader({ condition, hulpvraag, lifeDomainScores, className, }: ContextHeaderProps) { // Filter op leefgebieden met hoge prioriteit of lage scores const priorityDomains = lifeDomainScores?.filter( (s) => s.priority === 'hoog' || s.baseline <= 2 ) || []; return ( {/* Diagnose */}
Diagnose {condition ? (

{condition.code_display} {condition.severity_display && ( ({condition.severity_display}) )}

) : (

Geen diagnose vastgesteld

)}
{/* Hulpvraag */} {hulpvraag && (
Hulpvraag

“{hulpvraag}”

)} {/* Leefgebieden bars */} {priorityDomains.length > 0 && (
Prioritaire leefgebieden
{priorityDomains.map((score) => ( ))}
)}
); } interface LifeDomainBarProps { score: LifeDomainScore; } function LifeDomainBar({ score }: LifeDomainBarProps) { const meta = LIFE_DOMAIN_META[score.domain]; const progressPercent = (score.baseline / 5) * 100; const targetPercent = (score.target / 5) * 100; return (
{meta.emoji} {meta.shortLabel} {score.baseline} → {score.target}
{/* Target indicator */}
{/* Current progress */}
); }