import { Metadata } from "next";
import { Suspense } from "react";
import { I18nProvider, getServerI18n } from "@/i18n";
import { fetchProjects } from "@/app/api/projects";
import GenerateLateStartReport from "@/components/Report/LateStartReportGen";
import { Typography } from "@mui/material";

export const metadata: Metadata = {
    title: "Late Start Report",
};

const LateStartReport: React.FC = async () => {
    const { t } = await getServerI18n("reports");
    fetchProjects();

    return (
        <>
        <Typography variant="h4" marginInlineEnd={2}>
            {t("Project Cash Flow Report")}
          </Typography>
            <I18nProvider namespaces={["report", "common"]}>
                <Suspense fallback={<GenerateLateStartReport.Loading />}>
                    <GenerateLateStartReport />
                </Suspense>
            </I18nProvider>
        </>
    );
};

export default LateStartReport;
