import { AdminService } from "@/services/admin-service";
import { UsersManagementPage } from "@/components/admin/users";

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

    return <UsersManagementPage teams={teams} />;
  } 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>
    );
  }
}
