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:
@@ -6,30 +6,15 @@ import { useTasks } from '@/hooks/useTasks';
|
||||
interface HeaderContainerProps {
|
||||
title: string;
|
||||
subtitle: string;
|
||||
initialStats: {
|
||||
total: number;
|
||||
completed: number;
|
||||
inProgress: number;
|
||||
todo: number;
|
||||
backlog: number;
|
||||
cancelled: number;
|
||||
freeze: number;
|
||||
archived: number;
|
||||
completionRate: number;
|
||||
};
|
||||
}
|
||||
|
||||
export function HeaderContainer({ title, subtitle, initialStats }: HeaderContainerProps) {
|
||||
const { stats, syncing } = useTasks(
|
||||
{ limit: 1 }, // Juste pour les stats
|
||||
{ tasks: [], stats: { ...initialStats, backlog: 0, cancelled: 0, freeze: 0, archived: 0 } }
|
||||
);
|
||||
export function HeaderContainer({ title, subtitle }: HeaderContainerProps) {
|
||||
const { syncing } = useTasks();
|
||||
|
||||
return (
|
||||
<Header
|
||||
title={title}
|
||||
subtitle={subtitle}
|
||||
stats={stats}
|
||||
syncing={syncing}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user