feat: reintroduce TaskStats to HomePageClient and TasksProvider
- Added `initialStats` prop to `HomePageClient` and `TasksProvider` to enhance task management capabilities. - Updated data fetching in `page.tsx` to include task statistics, improving overall functionality. - Adjusted `useTasks` hook to utilize the new `stats` parameter, ensuring comprehensive task data handling.
This commit is contained in:
@@ -38,12 +38,13 @@ interface TasksProviderProps {
|
||||
children: ReactNode;
|
||||
initialTasks: Task[];
|
||||
initialTags?: (Tag & { usage: number })[];
|
||||
initialStats?: TaskStats;
|
||||
}
|
||||
|
||||
export function TasksProvider({ children, initialTasks, initialTags }: TasksProviderProps) {
|
||||
export function TasksProvider({ children, initialTasks, initialTags, initialStats }: TasksProviderProps) {
|
||||
const tasksState = useTasks(
|
||||
{ limit: 20 },
|
||||
{ tasks: initialTasks }
|
||||
{ tasks: initialTasks, stats: initialStats }
|
||||
);
|
||||
|
||||
const { tags, loading: tagsLoading, error: tagsError } = useTags(initialTags);
|
||||
|
||||
Reference in New Issue
Block a user