import React from "react";
import GenerateProjectPotentialDelayReportLoading from "./GenerateProjectPotentialDelayReportLoading";
import GenerateProjectPotentialDelayReport from "./GenerateProjectPotentialDelayReport";
import { fetchTeam } from "@/app/api/team";
import { fetchAllCustomers } from "@/app/api/customer";

interface SubComponents {
  Loading: typeof GenerateProjectPotentialDelayReportLoading;
}

const GenerateProjectPotentialDelayReportWrapper: React.FC & SubComponents = async () => {
  const [teams, clients] = await Promise.all([fetchTeam(), fetchAllCustomers()])

  return <GenerateProjectPotentialDelayReport teams={teams} clients={clients}/>;
};

GenerateProjectPotentialDelayReportWrapper.Loading = GenerateProjectPotentialDelayReportLoading;

export default GenerateProjectPotentialDelayReportWrapper;