// import { fetchDepartmentCategories, fetchDepartments } from "@/app/api/companys";
import React from "react";
import DepartmentSearch from "./DepartmentSearch";
import DepartmentSearchLoading from "./DepartmentSearchLoading";
import { fetchDepartments } from "@/app/api/departments";
import { fetchUserAbilities } from "@/app/utils/fetchUtil";

interface SubComponents {
  Loading: typeof DepartmentSearchLoading;
}

const DepartmentSearchWrapper: React.FC & SubComponents = async () => {
  const [Departments, abilities] = await Promise.all([fetchDepartments(), fetchUserAbilities()]);
  // const Departments:any[] = []

  return <DepartmentSearch departments={Departments} abilities={abilities} />;
};

DepartmentSearchWrapper.Loading = DepartmentSearchLoading;

export default DepartmentSearchWrapper;
