import { fetchProjectsLateStart } from "@/app/api/report";
import React from "react";
import LateStartReportGen from "./LateStartReportGen";
import LateStartReportGenLoading from "./LateStartReportGenLoading";
import { fetchAllCustomers } from "@/app/api/customer";
import { fetchAllSubsidiaries } from "@/app/api/subsidiary";

interface SubComponents {
  Loading: typeof LateStartReportGenLoading;
}

const LateStartReportGenWrapper: React.FC & SubComponents = async () => {
  const clentprojects = await fetchProjectsLateStart();
  const customers = await fetchAllCustomers();
  const subsidiaries = await fetchAllSubsidiaries();

  return <LateStartReportGen projects={clentprojects} clients={customers} subsidiaries={subsidiaries}/>;
};

LateStartReportGenWrapper.Loading = LateStartReportGenLoading;

export default LateStartReportGenWrapper;