- Added drag & drop capabilities to the Kanban board with @dnd-kit for task status updates. - Integrated DndContext in `KanbanBoard` and utilized `useDroppable` in `KanbanColumn` for drop zones. - Enhanced `TaskCard` with draggable features and visual feedback during dragging. - Updated `TODO.md` to reflect the completion of drag & drop tasks and optimistically update task statuses. - Introduced optimistic updates in `useTasks` for smoother user experience during drag & drop operations.
33 lines
649 B
TypeScript
33 lines
649 B
TypeScript
'use client';
|
|
|
|
import { Header } from './Header';
|
|
import { useTasks } from '@/hooks/useTasks';
|
|
|
|
interface HeaderContainerProps {
|
|
title: string;
|
|
subtitle: string;
|
|
initialStats: {
|
|
total: number;
|
|
completed: number;
|
|
inProgress: number;
|
|
todo: number;
|
|
completionRate: number;
|
|
};
|
|
}
|
|
|
|
export function HeaderContainer({ title, subtitle, initialStats }: HeaderContainerProps) {
|
|
const { stats, syncing } = useTasks(
|
|
{ limit: 1 }, // Juste pour les stats
|
|
{ tasks: [], stats: initialStats }
|
|
);
|
|
|
|
return (
|
|
<Header
|
|
title={title}
|
|
subtitle={subtitle}
|
|
stats={stats}
|
|
syncing={syncing}
|
|
/>
|
|
);
|
|
}
|