import { useState } from 'react' import { RECURRING_STATUSES, RECURRING_STATUS_LABELS } from '../constants/status.js' import { StatusBadge } from './StatusBadge.jsx' import { EmptyState } from './EmptyState.jsx' function formatDueAt(iso) { if (!iso) return null try { return new Date(iso).toLocaleString('de-DE') } catch { return iso } } export function RecurringSection({ items, canManage, onCreate, onUpdateStatus, onDelete, busy }) { const [title, setTitle] = useState('') const [nextDueAt, setNextDueAt] = useState('') const [showForm, setShowForm] = useState(false) async function handleSubmit(e) { e.preventDefault() if (!title.trim()) return await onCreate({ title: title.trim(), next_due_at: nextDueAt ? new Date(nextDueAt).toISOString() : null, }) setTitle('') setNextDueAt('') setShowForm(false) } return (

Wiederkehrend

{canManage && ( )}
{showForm && canManage && (
)} {items.length === 0 && }
) }