'use client'; import { useState } from 'react'; import { Input } from '@/components/ui/input'; import { Label } from '@/components/ui/label'; import { Textarea } from '@/components/ui/textarea'; import { Slider } from '@/components/ui/slider'; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@/components/ui/select'; import type { SmartGoal, GoalStatus } from '@/lib/types/behandelplan'; import { LIFE_DOMAINS, LIFE_DOMAIN_META, type LifeDomain } from '@/lib/types/leefgebieden'; interface GoalFormProps { initialData?: SmartGoal | null; onChange: (data: SmartGoal) => void; } const PRIORITY_OPTIONS = [ { value: 'hoog', label: 'Hoog' }, { value: 'middel', label: 'Middel' }, { value: 'laag', label: 'Laag' }, ]; const STATUS_OPTIONS: { value: GoalStatus; label: string }[] = [ { value: 'niet_gestart', label: 'Niet gestart' }, { value: 'bezig', label: 'Bezig' }, { value: 'gehaald', label: 'Gehaald' }, { value: 'bijgesteld', label: 'Bijgesteld' }, ]; export function GoalForm({ initialData, onChange }: GoalFormProps) { const [data, setData] = useState( initialData || { id: crypto.randomUUID(), title: '', description: '', clientVersion: '', lifeDomain: 'dlv', priority: 'middel', measurability: '', timelineWeeks: 8, status: 'niet_gestart', progress: 0, } ); const handleChange = (field: K, value: SmartGoal[K]) => { const updated = { ...data, [field]: value }; setData(updated); onChange(updated); }; return (
handleChange('title', e.target.value)} placeholder="Korte beschrijving van het doel" />