import { Metadata } from "next";
import { getServerI18n, I18nProvider } from "@/i18n";
import Typography from "@mui/material/Typography";
import { Stack } from "@mui/material";
import { Suspense } from "react";
import QcItemAllTabs from "@/components/QcItemAll/QcItemAllTabs";
import Tab0ItemQcCategoryMapping from "@/components/QcItemAll/Tab0ItemQcCategoryMapping";
import Tab1QcCategoryQcItemMapping from "@/components/QcItemAll/Tab1QcCategoryQcItemMapping";
import Tab2QcCategoryManagement from "@/components/QcItemAll/Tab2QcCategoryManagement";
import Tab3QcItemManagement from "@/components/QcItemAll/Tab3QcItemManagement";

export const metadata: Metadata = {
  title: "Qc Item All",
};

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

  return (
    <>
      <Stack
        direction="row"
        justifyContent="space-between"
        flexWrap="wrap"
        rowGap={2}
        sx={{ mb: 3 }}
      >
        <Typography variant="h4" marginInlineEnd={2}>
          {t("Qc Item All")}
        </Typography>
      </Stack>
      <Suspense fallback={<div>Loading...</div>}>
        <I18nProvider namespaces={["common", "qcItemAll", "qcCategory", "qcItem"]}>
          <QcItemAllTabs
            tab0Content={<Tab0ItemQcCategoryMapping />}
            tab1Content={<Tab1QcCategoryQcItemMapping />}
            tab2Content={<Tab2QcCategoryManagement />}
            tab3Content={<Tab3QcItemManagement />}
          />
        </I18nProvider>
      </Suspense>
    </>
  );
};

export default qcItemAll;


























