import { Metadata } from "next";
import { Suspense } from "react";
import { I18nProvider } from "@/i18n";
import { fetchProjects } from "@/app/api/projects";
import GenerateProjectCashFlowReport from "@/components/GenerateProjectCashFlowReport";

export const metadata: Metadata = {
    title: "Project Cash Flow Report",
};

const ProjectCashFlowReport: React.FC = async () => {
    fetchProjects();

    return (
        <>
            <I18nProvider namespaces={["report", "common"]}>
                <Suspense fallback={<GenerateProjectCashFlowReport.Loading />}>
                    <GenerateProjectCashFlowReport />
                </Suspense>
            </I18nProvider>
        </>
    );
};

export default ProjectCashFlowReport;
