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:
@@ -37,14 +37,13 @@ const TasksContext = createContext<TasksContextType | null>(null);
|
||||
interface TasksProviderProps {
|
||||
children: ReactNode;
|
||||
initialTasks: Task[];
|
||||
initialStats: TaskStats;
|
||||
initialTags?: (Tag & { usage: number })[];
|
||||
}
|
||||
|
||||
export function TasksProvider({ children, initialTasks, initialStats, initialTags }: TasksProviderProps) {
|
||||
export function TasksProvider({ children, initialTasks, initialTags }: TasksProviderProps) {
|
||||
const tasksState = useTasks(
|
||||
{ limit: 20 },
|
||||
{ tasks: initialTasks, stats: initialStats }
|
||||
{ tasks: initialTasks }
|
||||
);
|
||||
|
||||
const { tags, loading: tagsLoading, error: tagsError } = useTags(initialTags);
|
||||
|
||||
Reference in New Issue
Block a user