import { I18nProvider, getServerI18n } from "@/i18n";
import Stack from "@mui/material/Stack";
import Typography from "@mui/material/Typography";
import { Metadata } from "next";
import { Suspense } from "react";
import ExcelFileImport from "@/components/ExcelFileImport";

export const metadata: Metadata = {
  title: "Excel File Import",
};

const ImportExcel: React.FC = async () => {
  const { t } = await getServerI18n("importExcel", "navigation", "common");

  return (
    <I18nProvider namespaces={["importExcel", "navigation", "common"]}>
      <Stack
        direction="row"
        justifyContent="space-between"
        flexWrap="wrap"
        rowGap={2}
      >
        <Typography variant="h4" marginInlineEnd={2}>
          {t("title")}
        </Typography>
      </Stack>
      <Suspense>
        <ExcelFileImport />
      </Suspense>
    </I18nProvider>
  );
};

export default ImportExcel;
