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

{item.title}

{priorityLabels[item.priority].label}

{item.description}

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

Teilaufgaben

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