'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 { Progress } from '@/components/ui/progress'; import { cn } from '@/lib/utils'; import { type Behandeldoel, GOAL_STATUS_LABELS } from '@/lib/types/behandelplan'; import { LIFE_DOMAIN_META } from '@/lib/types/leefgebieden'; import { Target, Pencil, ChevronDown, ChevronUp } from 'lucide-react'; import { BehandeldoelForm } from './behandeldoel-form'; interface BehandeldoelCardProps { doel: Behandeldoel; isEditing: boolean; onEdit: () => void; onSave: (doel: Behandeldoel) => Promise; onCancel: () => void; onDelete?: () => Promise; className?: string; } /** * Behandeldoel Card * View mode: Compact card met doel + interventies * Edit mode: Inline form met alle velden */ export function BehandeldoelCard({ doel, isEditing, onEdit, onSave, onCancel, onDelete, className, }: BehandeldoelCardProps) { const [isExpanded, setIsExpanded] = useState(false); if (isEditing) { return ( ); } const meta = LIFE_DOMAIN_META[doel.lifeDomain]; const statusInfo = GOAL_STATUS_LABELS[doel.status]; return (

{doel.title}

{meta.shortLabel} {statusInfo.label}
{/* Client version (B1 tekst) - altijd zichtbaar */}

“{doel.clientVersion}”

{/* Interventies */} {doel.interventies.length > 0 && (
Aanpak
    {doel.interventies.map((int) => (
  • {int.name} {int.description && ( - {int.description} )}
  • ))}
)} {/* Progress & timeline */}
Week {doel.startWeek}-{doel.endWeek} {doel.progress}%
{/* Expanded details (optional) */} {isExpanded && (

Leefgebied: {meta.label}

Status: {statusInfo.label}

)}
); }