'use client'; import { useState } from 'react'; import { Card, CardContent, CardHeader } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; import { cn } from '@/lib/utils'; import { type Behandelstructuur, type Evaluatiemoment, type Veiligheidsplan, EVALUATION_STATUSES, } from '@/lib/types/behandelplan'; import { ChevronDown, ChevronRight, Calendar, Clock, Shield, AlertTriangle, Phone, CheckCircle2, } from 'lucide-react'; interface PlanningSectionProps { behandelstructuur: Behandelstructuur | null; evaluatiemomenten: Evaluatiemoment[] | null; veiligheidsplan: Veiligheidsplan | null; className?: string; } /** * Blok 3: Planning & Evaluatie * Collapsed by default, bevat: * - Evaluatiemomenten * - Behandelstructuur * - Veiligheidsplan (indien aanwezig) */ export function PlanningSection({ behandelstructuur, evaluatiemomenten, veiligheidsplan, className, }: PlanningSectionProps) { const [isExpanded, setIsExpanded] = useState(false); const evaluatiesCount = evaluatiemomenten?.length || 0; const hasVeiligheidsplan = !!veiligheidsplan; // Count pending evaluations const pendingEvaluaties = evaluatiemomenten?.filter((e) => e.status === 'gepland').length || 0; return ( {/* Collapsed header */} setIsExpanded(!isExpanded)} >
{isExpanded ? ( ) : ( )} Planning & Evaluatie
{pendingEvaluaties > 0 && ( {pendingEvaluaties} gepland )} {hasVeiligheidsplan && ( Veiligheidsplan )}
{/* Expanded content */} {isExpanded && ( {/* Behandelstructuur */} {behandelstructuur && (

Behandelstructuur

{behandelstructuur.duur}
{behandelstructuur.frequentie} {behandelstructuur.aantalSessies} sessies {behandelstructuur.vorm}
)} {/* Evaluatiemomenten */} {evaluatiemomenten && evaluatiemomenten.length > 0 && (

Evaluatiemomenten

{evaluatiemomenten.map((eval_) => ( ))}
)} {/* Veiligheidsplan */} {veiligheidsplan && ( )}
)}
); } interface EvaluatieItemProps { evaluatie: Evaluatiemoment; } function EvaluatieItem({ evaluatie }: EvaluatieItemProps) { const isCompleted = evaluatie.status === 'afgerond'; const typeLabel = evaluatie.type === 'tussentijds' ? 'Tussentijds' : evaluatie.type === 'eind' ? 'Eind' : 'Crisis'; return (
{isCompleted ? ( ) : (
)}

Week {evaluatie.weekNumber}: {typeLabel}

{evaluatie.plannedDate && (

{new Date(evaluatie.plannedDate).toLocaleDateString('nl-NL', { day: 'numeric', month: 'short', })}

)}
); } interface VeiligheidsplanSectionProps { veiligheidsplan: Veiligheidsplan; } function VeiligheidsplanSection({ veiligheidsplan }: VeiligheidsplanSectionProps) { return (

Veiligheidsplan

{/* Waarschuwingssignalen */} {veiligheidsplan.waarschuwingssignalen.length > 0 && (

Waarschuwingssignalen

    {veiligheidsplan.waarschuwingssignalen.map((signal, i) => (
  • {signal}
  • ))}
)} {/* Coping strategieën */} {veiligheidsplan.copingStrategieen.length > 0 && (

Coping strategieën

    {veiligheidsplan.copingStrategieen.map((strategy, i) => (
  • {strategy}
  • ))}
)} {/* Contacten */} {veiligheidsplan.contacten.length > 0 && (

Noodcontacten

{veiligheidsplan.contacten.map((contact, i) => (

{contact.naam}

{contact.rol}

{contact.telefoon}

))}
)}
); }