import { Edit } from "@mui/icons-material";
import { useSearchParams } from "next/navigation";
// import EditStaff from "@/components/EditStaff";
import { Suspense } from "react";
import { I18nProvider } from "@/i18n";
// import EditStaffWrapper from "@/components/EditStaff/EditStaffWrapper";
import { Metadata } from "next";
import EditUser from "@/components/EditUser";
import { preloadUserDetail } from "@/app/api/user";
import { searchParamsProps } from "@/app/utils/fetchUtil";


const EditUserPage: React.FC<searchParamsProps> = async ({
  searchParams
}) => {
  const id = parseInt(searchParams.id as string)
  preloadUserDetail(id)

  return (
    <>
      <I18nProvider namespaces={["user", "common"]}>
        <Suspense fallback={<EditUser.Loading />}>
          <EditUser 
            searchParams={searchParams}
          />
        </Suspense>
      </I18nProvider>
    </>
  );
};

export default EditUserPage;
