import { AdminService } from "@/services/admin-service";
import { SkillsManagementPage } from "@/components/admin/skills";

export default async function SkillsPage() {
  // Charger les données côté serveur
  try {
    const { skillCategories, skills } = await AdminService.getSkillsPageData();

    return (
      <SkillsManagementPage
        skillCategories={skillCategories}
        initialSkills={skills}
      />
    );
  } 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>
    );
  }
}
