- Removed initialTasks and initialStats props from KanbanBoardContainer, now using TasksContext for task management. - Updated useTasks hook to include a simulated delay for sync indicator during task updates. - Replaced KanbanBoardContainer with HomePageClient in the HomePage component for a cleaner structure.
45 lines
1.1 KiB
TypeScript
45 lines
1.1 KiB
TypeScript
'use client';
|
|
|
|
import { KanbanBoardContainer } from '@/components/kanban/BoardContainer';
|
|
import { Header } from '@/components/ui/Header';
|
|
import { TasksProvider, useTasksContext } from '@/contexts/TasksContext';
|
|
import { Task } from '@/lib/types';
|
|
|
|
interface HomePageClientProps {
|
|
initialTasks: Task[];
|
|
initialStats: {
|
|
total: number;
|
|
completed: number;
|
|
inProgress: number;
|
|
todo: number;
|
|
completionRate: number;
|
|
};
|
|
}
|
|
|
|
function HomePageContent() {
|
|
const { stats, syncing } = useTasksContext();
|
|
|
|
return (
|
|
<div className="min-h-screen bg-slate-950">
|
|
<Header
|
|
title="TowerControl"
|
|
subtitle="Gestionnaire de tâches moderne"
|
|
stats={stats}
|
|
syncing={syncing}
|
|
/>
|
|
|
|
<main className="h-[calc(100vh-120px)]">
|
|
<KanbanBoardContainer />
|
|
</main>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export function HomePageClient({ initialTasks, initialStats }: HomePageClientProps) {
|
|
return (
|
|
<TasksProvider initialTasks={initialTasks} initialStats={initialStats}>
|
|
<HomePageContent />
|
|
</TasksProvider>
|
|
);
|
|
}
|