import React, { useState, useEffect } from 'react'; import { useAuth } from '../../contexts/AuthContext'; import { departmentsAPI, kanbanAPI } from '../../services/api'; import ConfirmDialog from '../Common/ConfirmDialog'; import type { KanbanCard, User, Department, KanbanChecklistWithItems } from '../../types'; const AddChecklistItemForm: React.FC<{ checklistId: number; onAdd: (checklistId: number, title: string) => void }> = ({ checklistId, onAdd }) => { const [title, setTitle] = useState(''); const [isAdding, setIsAdding] = useState(false); const handleSubmit = () => { if (title.trim()) { onAdd(checklistId, title); setTitle(''); setIsAdding(false); } }; const handleKeyPress = (e: React.KeyboardEvent) => { if (e.key === 'Enter') { handleSubmit(); } else if (e.key === 'Escape') { setTitle(''); setIsAdding(false); } }; if (!isAdding) { return ( ); } return (
{uploading ? 'Wird hochgeladen...' : 'Datei hochladen'}
{uploading ? 'Bitte warten...' : 'Klicken oder ziehen'}
{attachment.filename || attachment.name}
{attachment.created_at ? new Date(attachment.created_at).toLocaleDateString('de-DE') : ''}
{comment.content}
{log.action === 'updated' && `${log.field_name} aktualisiert`} {log.action === 'moved' && `Zu ${log.new_value} verschoben`} {log.action === 'created' && 'Karte erstellt'} {log.action === 'archived' && 'Karte archiviert'} {!['updated', 'moved', 'created', 'archived'].includes(log.action) && log.action}
{log.action === 'updated' && log.old_value && log.new_value && (Von {log.old_value} zu {log.new_value}
)}{new Date(log.created_at).toLocaleString('de-DE')}