import { tasksService } from '@/services/task-management/tasks';
import { tagsService } from '@/services/task-management/tags';
import { HomePageClient } from '@/components/HomePageClient';

// Force dynamic rendering (no static generation)
export const dynamic = 'force-dynamic';

export default async function HomePage() {
  // SSR - Récupération des données côté serveur
  const [initialTasks, initialTags, initialStats] = await Promise.all([
    tasksService.getTasks(),
    tagsService.getTags(),
    tasksService.getTaskStats()
  ]);

  return (
    <HomePageClient 
      initialTasks={initialTasks}
      initialTags={initialTags}
      initialStats={initialStats}
    />
  );
}
