feat: remove TaskStats from HomePageClient and Header components

- Eliminated `initialStats` prop from `HomePageClient` and `KanbanPageClient` to streamline data handling.
- Updated `Header` and `HeaderContainer` components to remove references to `stats`, enhancing clarity and reducing unnecessary complexity.
- Adjusted `useTasks` hook to make `stats` optional, ensuring compatibility with the updated components.
This commit is contained in:
Julien Froidefond
2025-09-19 08:57:51 +02:00
parent 128167341e
commit 013b3d4d40
8 changed files with 142 additions and 142 deletions

View File

@@ -3,7 +3,7 @@
import { Header } from '@/components/ui/Header';
import { TasksProvider, useTasksContext } from '@/contexts/TasksContext';
import { UserPreferencesProvider } from '@/contexts/UserPreferencesContext';
import { Task, Tag, TaskStats, UserPreferences } from '@/lib/types';
import { Task, Tag, UserPreferences } from '@/lib/types';
import { CreateTaskData } from '@/clients/tasks-client';
import { DashboardStats } from '@/components/dashboard/DashboardStats';
import { QuickActions } from '@/components/dashboard/QuickActions';
@@ -12,7 +12,6 @@ import { ProductivityAnalytics } from '@/components/dashboard/ProductivityAnalyt
interface HomePageClientProps {
initialTasks: Task[];
initialStats: TaskStats;
initialTags: (Tag & { usage: number })[];
initialPreferences: UserPreferences;
}
@@ -29,9 +28,8 @@ function HomePageContent() {
return (
<div className="min-h-screen bg-[var(--background)]">
<Header
title="TowerControl"
title="TowerControl"
subtitle="Dashboard - Vue d'ensemble"
stats={stats}
syncing={syncing}
/>
@@ -52,12 +50,11 @@ function HomePageContent() {
);
}
export function HomePageClient({ initialTasks, initialStats, initialTags, initialPreferences }: HomePageClientProps) {
export function HomePageClient({ initialTasks, initialTags, initialPreferences }: HomePageClientProps) {
return (
<UserPreferencesProvider initialPreferences={initialPreferences}>
<TasksProvider
initialTasks={initialTasks}
initialStats={initialStats}
initialTasks={initialTasks}
initialTags={initialTags}
>
<HomePageContent />