import { useState } from 'react' import { MILESTONE_STATUSES, MILESTONE_STATUS_LABELS, } from '../constants/status.js' import { StatusBadge } from './StatusBadge.jsx' import { EmptyState } from './EmptyState.jsx' function formatDate(value) { if (!value) return null try { return new Date(value.includes('T') ? value : `${value}T12:00:00`).toLocaleDateString( 'de-DE' ) } catch { return value } } export function MilestonesSection({ milestones, canManage, onCreate, onUpdateStatus, onDelete, busy, compact = false, }) { const [title, setTitle] = useState('') const [goalDescription, setGoalDescription] = useState('') const [targetDate, setTargetDate] = useState('') const [showForm, setShowForm] = useState(false) async function handleSubmit(e) { e.preventDefault() if (!title.trim()) return await onCreate({ title: title.trim(), goal_description: goalDescription.trim(), target_date: targetDate || undefined, }) setTitle('') setGoalDescription('') setTargetDate('') setShowForm(false) } return (

Meilensteine

Überprüfbare Zielpunkte — kein Task. Ziel und Termin machen den Horizont steuerbar.

{canManage && ( )}
{showForm && canManage && (