import { Edit } from "@mui/icons-material";
import { useSearchParams } from "next/navigation";
// import EditStaff from "@/components/EditStaff";
import { Suspense } from "react";
import { I18nProvider, getServerI18n } from "@/i18n";
// import EditStaffWrapper from "@/components/EditStaff/EditStaffWrapper";
import { Metadata } from "next";
import EditSkill from "@/components/EditSkill";
import { Typography } from "@mui/material";
import { fetchSkill } from "@/app/api/skill";

export interface searchParamsProps {
  searchParams: { [key: string]: string | string[] | undefined };
}

const EditSkillPage: React.FC<searchParamsProps> = async ({
  searchParams,
}) => {
    console.log(searchParams.id)
    const { t } = await getServerI18n("staff");

  return (

      <>
        <Typography variant="h4">{t("Edit Skill")}</Typography>
        <I18nProvider namespaces={["team", "common"]}>
          <Suspense fallback={<EditSkill.Loading />}>
            <EditSkill id={parseInt(searchParams.id as string)}/>
          </Suspense>
        </I18nProvider>
      </> 
  );
};

export default EditSkillPage;
