import ProductionProcessPage from "../../../components/ProductionProcess/ProductionProcessPage";
import { I18nProvider, getServerI18n } 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";
import { fetchPrinterCombo } from "@/app/api/settings/printer";

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

const production: React.FC = async () => {
  const { t } = await getServerI18n("production", "common");
  const printerCombo = await fetchPrinterCombo();
  return (
    <>
      <Stack
        direction="row"
        justifyContent="space-between"
        flexWrap="wrap"
        rowGap={2}
      >
        <Typography variant="h4" marginInlineEnd={2}>
          {t("Production Process")}
        </Typography>
        {/* Optional: Remove or modify create button, because creation is done via API automatically */}
        {/* <Button
          variant="contained"
          startIcon={<Add />}
          LinkComponent={Link}
          href="/production/create"
        >
          {t("Create Process")}
        </Button> */}
      </Stack>
      <I18nProvider namespaces={["production","productionProcess","navigation","common","purchaseOrder","jo","dashboard"]}>
        <ProductionProcessPage printerCombo={printerCombo} />  {/* Use new component */}
      </I18nProvider>
    </>
  );
};


export default production;
