import { TypeEnum } from "@/app/utils/typeEnum";
import { 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 Tab from "@mui/material/Tab";
import Tabs from "@mui/material/Tabs";
import { Metadata } from "next";
import Link from "next/link";
import { Suspense } from "react";
import { fetchAllEquipments } from "@/app/api/settings/equipment";
import { I18nProvider } from "@/i18n";
import EquipmentSearchWrapper from "@/components/EquipmentSearch/EquipmentSearchWrapper";
import EquipmentSearchLoading from "@/components/EquipmentSearch/EquipmentSearchLoading";

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

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

  return (
    <>
      <Stack
        direction="row"
        justifyContent="space-between"
        flexWrap="wrap"
        rowGap={2}
      >
        <Typography variant="h4" marginInlineEnd={2}>
          {t("Equipment")}
        </Typography>
      </Stack>
      <Suspense fallback={<EquipmentSearchLoading />}>
        <I18nProvider namespaces={["equipment","navigation","common","project"]}>
          <EquipmentSearchWrapper />
        </I18nProvider>
      </Suspense>
    </>
  );
};

export default productSetting;