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

export const metadata: Metadata = {
    title: "Cross Team Charge Report",
};

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

    return (
        <>
            <Typography variant="h4" marginInlineEnd={2}>
                {t("Cross Team Charge Report")}
            </Typography>
            <I18nProvider namespaces={["report", "common"]}>
                <Suspense fallback={<GenerateCrossTeamChargeReport.Loading />}>
                    <GenerateCrossTeamChargeReport />
                </Suspense>
            </I18nProvider>
        </>
    );
};

export default CrossTeamChargeReport;