import { useState } from 'react' import { BLOCKER_STATUSES, BLOCKER_STATUS_LABELS, } from '../constants/status.js' import { StatusBadge } from './StatusBadge.jsx' import { EmptyState } from './EmptyState.jsx' export function BlockersSection({ blockers, canManage, onCreate, onUpdateStatus, onDelete, busy, heading = 'Blocker', lead = null, emptyMessage = 'Keine Blocker.', }) { const [formTitle, setFormTitle] = useState('') const [showForm, setShowForm] = useState(false) async function handleSubmit(e) { e.preventDefault() if (!formTitle.trim()) return await onCreate({ title: formTitle.trim() }) setFormTitle('') setShowForm(false) } return (

{heading}

{lead &&

{lead}

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