import { AdminService } from "@/services/admin-service";
import { TeamsManagementPage } from "@/components/admin/teams";

export default async function TeamsPage() {
  // Charger les données côté serveur
  try {
    const { teams, teamStats, skillCategories } =
      await AdminService.getAdminData();

    return (
      <TeamsManagementPage
        teams={teams}
        teamStats={teamStats}
        skillCategories={skillCategories}
      />
    );
  } catch (error) {
    console.error("Failed to load admin data:", error);
    return (
      <div className="container mx-auto p-6">
        <div className="flex items-center justify-center h-64">
          <div className="text-lg text-red-500">
            Erreur lors du chargement des données d'administration
          </div>
        </div>
      </div>
    );
  }
}
