import { Edit } from "@mui/icons-material";
import { Metadata } from "next";
import { I18nProvider, getServerI18n } from "@/i18n";
import EditUser from "@/components/EditUser";
import { Typography } from "@mui/material";
import { Suspense } from "react";
import { preloadUser } from "@/app/api/user";
import { searchParamsProps } from "@/app/utils/fetchUtil";

const User: React.FC<searchParamsProps> = async ({ searchParams }) => {
  const { t } = await getServerI18n("user");
  preloadUser();
  return (
    <>
      <Typography variant="h4">{t("Edit User")}</Typography>
      <I18nProvider namespaces={["user", "common"]}>
        <Suspense fallback={<EditUser.Loading />}>
          <EditUser searchParams={searchParams} />
        </Suspense>
      </I18nProvider>
    </>
  );
};
export default User;
