/** * @file dashboard/KanbanCard.tsx * @description Client component rendering a single kanban card container with native drag-and-drop source handlers and modular sub-components. */ "use client"; import { KanbanCardProps, TaskStatus } from "@/types/tasks"; import KanbanCardActions from "./components/KanbanCardActions"; import KanbanCardAvatars from "./components/KanbanCardAvatars"; import KanbanCardDueDate from "./components/KanbanCardDueDate"; import KanbanCardPriority from "./components/KanbanCardPriority"; /** * Renders an interactive kanban card container holding title, description, * modular priority badges, deadline elements, assignees, and action triggers. * * @param {KanbanCardProps} props - The component props containing the task object and status change handler. * @returns {JSX.Element} The rendered kanban card container component. */ export default function KanbanCard({ task, onStatusChange }: KanbanCardProps) { /** * Initiates the drag action on a task card, storing its ID and current status in the data transfer payload. * * @param {React.DragEvent} e - The drag event object. */ const handleDragStart = (e: React.DragEvent) => { e.dataTransfer.setData("text/plain", task.id); e.dataTransfer.setData("sourceStatus", task.status); e.dataTransfer.effectAllowed = "move"; }; /** * Triggers the status change callback with the target task ID and new status. * * @param {TaskStatus} newStatus - The target task status to transition to. */ const handleMove = (newStatus: TaskStatus) => { if (onStatusChange) { onStatusChange(task.id, newStatus); } }; return (
{/* --- Card Header --- */}

{task.title}

{/* Card Priority */}
{/* Card Description */}

{task.description}

{/* --- Card Footer --- */}
{/* Date Badge Component */} {/* Avatars & Mobile Switcher */}
); }