'use client' import { ChevronRight } from 'lucide-react' import type { BacklogItem, BacklogCategory } from '../types' import { statusLabels, priorityLabels } from '../data' interface BacklogItemCardProps { item: BacklogItem category: BacklogCategory | undefined isExpanded: boolean onToggleExpand: (id: string) => void onUpdateStatus: (id: string, status: BacklogItem['status']) => void onToggleSubtask: (itemId: string, subtaskId: string) => void } export function BacklogItemCard({ item, category, isExpanded, onToggleExpand, onUpdateStatus, onToggleSubtask, }: BacklogItemCardProps) { const completedSubtasks = item.subtasks?.filter((st) => st.completed).length || 0 const totalSubtasks = item.subtasks?.length || 0 return (
onToggleExpand(item.id)} >
{/* Expand Icon */} {/* Content */}

{item.title}

{priorityLabels[item.priority].label}

{item.description}

{item.notes && (

{item.notes}

)}
{category?.name} {totalSubtasks > 0 && ( {completedSubtasks}/{totalSubtasks} Teilaufgaben )}
{/* Status */}
{/* Progress Bar */} {totalSubtasks > 0 && (
)}
{/* Expanded Subtasks */} {isExpanded && item.subtasks && item.subtasks.length > 0 && (

Teilaufgaben

    {item.subtasks.map((subtask) => (
  • onToggleSubtask(item.id, subtask.id)} className="w-4 h-4 rounded border-slate-300 text-blue-600 focus:ring-blue-500" /> {subtask.title}
  • ))}
)}
) }