feat: integrate tags into HomePage and TasksContext
- Added `initialTags` prop to `HomePageClient` for passing tag data. - Updated `TasksProvider` to accept and utilize `initialTags`, enhancing tag management. - Modified `useTags` hook to initialize state with provided tags and conditionally refresh tags based on initial data. - Updated server-side data fetching in `HomePage` to include tags from the `tagsService`.
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import { KanbanBoardContainer } from '@/components/kanban/BoardContainer';
|
||||
import { Header } from '@/components/ui/Header';
|
||||
import { TasksProvider, useTasksContext } from '@/contexts/TasksContext';
|
||||
import { Task } from '@/lib/types';
|
||||
import { Task, Tag } from '@/lib/types';
|
||||
|
||||
interface HomePageClientProps {
|
||||
initialTasks: Task[];
|
||||
@@ -14,6 +14,7 @@ interface HomePageClientProps {
|
||||
todo: number;
|
||||
completionRate: number;
|
||||
};
|
||||
initialTags: (Tag & { usage: number })[];
|
||||
}
|
||||
|
||||
function HomePageContent() {
|
||||
@@ -35,9 +36,13 @@ function HomePageContent() {
|
||||
);
|
||||
}
|
||||
|
||||
export function HomePageClient({ initialTasks, initialStats }: HomePageClientProps) {
|
||||
export function HomePageClient({ initialTasks, initialStats, initialTags }: HomePageClientProps) {
|
||||
return (
|
||||
<TasksProvider initialTasks={initialTasks} initialStats={initialStats}>
|
||||
<TasksProvider
|
||||
initialTasks={initialTasks}
|
||||
initialStats={initialStats}
|
||||
initialTags={initialTags}
|
||||
>
|
||||
<HomePageContent />
|
||||
</TasksProvider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user