import CreateCompany from "@/components/CreateCompany";
import { I18nProvider, getServerI18n } from "@/i18n";
import Typography from "@mui/material/Typography";
import { Metadata } from "next";

export const metadata: Metadata = {
    title: "Create Comapny",
};

interface Props {
  searchParams: { [key: string]: string | undefined };
}
  
const Companys: React.FC<Props> = async ({searchParams}) => {
    const { t } = await getServerI18n("companys");
    
    const companyId = searchParams["id"];

    return(
        <>
      <Typography variant="h4">{t("Edit Company")}</Typography>
      <I18nProvider namespaces={["companys"]}>
        <CreateCompany isEdit={true} companyId={companyId} />
      </I18nProvider>
    </>
    )

}

export default Companys;