/** * @file dashboard/components/KanbanBoardHeader.tsx * @description Component rendering the top title header with an integrated delete drop zone that appears during drag-and-drop interactions, plus a link to the trash bin view. */ "use client"; import { useState, useEffect } from "react"; import { Plus, Sparkles, Trash2 } from "lucide-react"; import Link from "next/link"; /** * Renders the dashboard header featuring a workspace title, subtitle, new task action button, * a dynamic delete drop zone during drag operations, and a trash navigation link with a counter badge. * * @param {Object} props - The component props. * @param {(taskId: string) => void} props.onTaskDelete - Callback function invoked when a task is dropped into the delete zone. * @param {number} props.trashCount - The current count of items in the trash bin. * @returns {JSX.Element} The rendered kanban board header component. */ export default function KanbanBoardHeader({ onTaskDelete, trashCount, }: { onTaskDelete: (taskId: string) => void; trashCount: number; }) { const [isDragging, setIsDragging] = useState(false); const [isOver, setIsOver] = useState(false); useEffect(() => { const handleDragStart = () => setIsDragging(true); const handleDragEnd = () => { setIsDragging(false); setIsOver(false); }; window.addEventListener("dragstart", handleDragStart); window.addEventListener("dragend", handleDragEnd); return () => { window.removeEventListener("dragstart", handleDragStart); window.removeEventListener("dragend", handleDragEnd); }; }, []); return (
Manage your tasks and keep track of your progress.