import React from "react";
import GenerateProjectCashFlowReportLoading from "./GenerateProjectCashFlowReportLoading";
import { fetchProjects } from "@/app/api/projects";
import GenerateProjectCashFlowReport from "./GenerateProjectCashFlowReport";

interface SubComponents {
  Loading: typeof GenerateProjectCashFlowReportLoading;
}

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

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

GenerateProjectCashFlowReportWrapper.Loading = GenerateProjectCashFlowReportLoading;

export default GenerateProjectCashFlowReportWrapper;