import { Header } from '@/components/ui/Header';
import { ManagerSummaryService } from '@/services/analytics/manager-summary';
import { tasksService } from '@/services/task-management/tasks';
import { tagsService } from '@/services/task-management/tags';
import { WeeklyManagerPageClient } from './WeeklyManagerPageClient';

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

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

  return (
    <div className="min-h-screen bg-[var(--background)]">
      <Header />
      
      <div className="container mx-auto px-4 py-8">
        <div className="max-w-6xl mx-auto">
          <WeeklyManagerPageClient 
            initialSummary={summary}
            initialTasks={initialTasks}
            initialTags={initialTags}
          />
        </div>
      </div>
    </div>
  );
}
