import React from "react";
import GenerateProjectPandLReportLoading from "./GenerateProjectPandLReportLoading";
import { fetchProjects } from "@/app/api/projects";
import GenerateProjectPandLReport from "./GenerateProjectPandLReport";

interface SubComponents {
  Loading: typeof GenerateProjectPandLReportLoading;
}

const GenerateProjectPandLReportWrapper: React.FC & SubComponents = async () => {
  const projects = await fetchProjects();

  return <GenerateProjectPandLReport projects={projects} />;
};

GenerateProjectPandLReportWrapper.Loading = GenerateProjectPandLReportLoading;

export default GenerateProjectPandLReportWrapper;