- 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`.
21 lines
569 B
TypeScript
21 lines
569 B
TypeScript
import { tasksService } from '@/services/tasks';
|
|
import { tagsService } from '@/services/tags';
|
|
import { HomePageClient } from '@/components/HomePageClient';
|
|
|
|
export default async function HomePage() {
|
|
// SSR - Récupération des données côté serveur
|
|
const [initialTasks, initialStats, initialTags] = await Promise.all([
|
|
tasksService.getTasks(),
|
|
tasksService.getTaskStats(),
|
|
tagsService.getTags()
|
|
]);
|
|
|
|
return (
|
|
<HomePageClient
|
|
initialTasks={initialTasks}
|
|
initialStats={initialStats}
|
|
initialTags={initialTags}
|
|
/>
|
|
);
|
|
}
|