FPSMS-frontend
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

37 righe
1.1 KiB

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