refactor: simplify BoardContainer and update task management
- 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.
This commit is contained in:
44
components/HomePageClient.tsx
Normal file
44
components/HomePageClient.tsx
Normal file
@@ -0,0 +1,44 @@
|
||||
'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>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user