// import { fetchTeam, fetchTeamLeads } from "@/app/api/Team";
import React from "react";
import TeamSearch from "./TeamSearch";
import TeamSearchLoading from "./TeamSearchLoading";
import { fetchTeam } from "@/app/api/team";
import { fetchUserAbilities } from "@/app/utils/fetchUtil";
// import { preloadTeam } from "@/app/api/Team";

interface SubComponents {
  Loading: typeof TeamSearchLoading;
}

const TeamSearchWrapper: React.FC & SubComponents = async () => {
  const [Team, abilities] = await Promise.all([fetchTeam(), fetchUserAbilities()]);
  console.log(Team);

  return <TeamSearch team={Team} abilities={abilities}/>;
};

TeamSearchWrapper.Loading = TeamSearchLoading;

export default TeamSearchWrapper;
