FPSMS-frontend
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.
 
 
 

32 rader
968 B

  1. import { SearchParams } from "@/app/utils/fetchUtil";
  2. import { TypeEnum } from "@/app/utils/typeEnum";
  3. import CreateProductMaterial from "@/components/CreateProductMaterial";
  4. import { I18nProvider, getServerI18n } from "@/i18n";
  5. import { Typography } from "@mui/material";
  6. import { isString } from "lodash";
  7. import { notFound } from "next/navigation";
  8. type Props = {} & SearchParams;
  9. const materialSetting: React.FC<Props> = async ({ searchParams }) => {
  10. const type = TypeEnum.MATERIAL;
  11. const { t } = await getServerI18n(type);
  12. console.log(searchParams);
  13. const id = isString(searchParams["id"])
  14. ? parseInt(searchParams["id"])
  15. : undefined;
  16. console.log(id)
  17. if (!id) {
  18. notFound();
  19. }
  20. return (
  21. <>
  22. {/* <Typography variant="h4">{t("Create Material")}</Typography> */}
  23. <I18nProvider namespaces={[type]}>
  24. <CreateProductMaterial type={type} id={id} />
  25. </I18nProvider>
  26. </>
  27. );
  28. };
  29. export default materialSetting;