import { TypeEnum } from "@/app/utils/typeEnum";
import EquipmentSearch from "@/components/EquipmentSearch";
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 { Metadata } from "next";
import Link from "next/link";
import { Suspense } from "react";
import { fetchAllEquipments } from "@/app/api/settings/equipment";
import { I18nProvider } from "@/i18n";
export const metadata: Metadata = {
  title: "Equipment Type",
};

const productSetting: React.FC = async () => {
  const type = "common";
  const { t } = await getServerI18n(type);
  const equipments = await fetchAllEquipments();
  //   preloadClaims();

  return (
    <>
      <Stack
        direction="row"
        justifyContent="space-between"
        flexWrap="wrap"
        rowGap={2}
      >
        <Typography variant="h4" marginInlineEnd={2}>
          {t("Equipment")}
        </Typography>
        {/* <Button
          variant="contained"
          startIcon={<Add />}
          LinkComponent={Link}
          href="product/create"
        >
          {t("Create product")}
        </Button> */}
      </Stack>
      <Suspense fallback={<EquipmentSearch.Loading />}>
        <I18nProvider namespaces={["common", "project"]}>
          <EquipmentSearch />
        </I18nProvider>
      </Suspense>
    </>
  );
};

export default productSetting;
