// "use client";
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 { searchParamsProps } from "@/app/utils/fetchUtil";

// export const metadata: Metadata = {
//     title: "staff-edit",
//   };

const EditStaffPage: React.FC<searchParamsProps> = async ({
  searchParams,
}) => {
    // const searchParams = useSearchParams();
    // const userId = searchParams.get('param');
    // console.log(userId); // Access the value of the "user_id" parameter

  return (
    <>
      <I18nProvider namespaces={["staff", "common"]}>
        <Suspense fallback={<EditStaff.Loading />}>
          <EditStaff id={parseInt(searchParams.id as string)}/>
        </Suspense>
      </I18nProvider>
      {/* <EditStaff /> */}
    </>
  );
};

export default EditStaffPage;
