// import { TypeEnum } from "@/app/utils/typeEnum";
// import RoughSchedule from "@/components/RoughSchedule";
// import { getServerI18n, I18nProvider } from "@/i18n";
import { testRoughSchedule } from "@/app/api/scheduling/actions";
import { TypeEnum } from "../../../../app/utils/typeEnum";
import RoughSchedule from "../../../../components/RoughSchedule";
import { getServerI18n, I18nProvider } from "../../../../i18n";
import Add from "@mui/icons-material/Add";
import Button from "@mui/material/Button";
import Stack from "@mui/material/Stack";
import Typography from "@mui/material/Typography";
import { Metadata } from "next";
import Link from "next/link";
import { Suspense } from "react";

export const metadata: Metadata = {
  title: "Demand Forecast",
};

const roughScheduling: React.FC = async () => {
  // const project = TypeEnum.PRODUCT
  const { t } = await getServerI18n("schedule");
  const type = "rough";
  //   preloadClaims();

  // async function testingRoughSchedule() {
  //     await testRoughSchedule();
  // }

  return (
    <>
      <Stack
        direction="row"
        justifyContent="space-between"
        flexWrap="wrap"
        rowGap={2}
      >
        <Typography variant="h4" marginInlineEnd={2}>
          {t("Demand Forecast")}
        </Typography>

        {/* <Button
                    variant="contained"
                    startIcon={<Add />}
                    onClick={() => testingRoughSchedule}
                >
                    {t("Test Rough Scheduling")}
                </Button> */}
      </Stack>
      <I18nProvider namespaces={["schedule","navigation","common"]}>
        <Suspense fallback={<RoughSchedule.Loading />}>
          <RoughSchedule type={type} />
        </Suspense>
      </I18nProvider>
    </>
  );
};

export default roughScheduling;
