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

export const metadata: Metadata = {
    title: "Project Manhour Summary Monthly Report",
};

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

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

export default ProjectManhourSummaryReport;