import React from "react";
import CreateTeam from "./CreateTeam";
import CreateTeamLoading from "./CreateTeamLoading";
// import { fetchTeam, fetchTeamLeads } from "@/app/api/team";
import { useSearchParams } from "next/navigation";
import { fetchStaff, fetchStaffWithoutTeam } from "@/app/api/staff";

interface SubComponents {
  Loading: typeof CreateTeamLoading;
} 

const CreateTeamWrapper: React.FC & SubComponents = async () => {

  const [
    staff,
  ] = await Promise.all([
    fetchStaffWithoutTeam(),
  ]);

  return <CreateTeam allstaff={staff}/>;
};

CreateTeamWrapper.Loading = CreateTeamLoading;

export default CreateTeamWrapper;
