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.
|
- import { SearchParams } from "@/app/utils/fetchUtil";
- import { TypeEnum } from "@/app/utils/typeEnum";
- import CreateProductMaterial from "@/components/CreateProductMaterial";
- import { I18nProvider, getServerI18n } from "@/i18n";
- import { Typography } from "@mui/material";
- import { isString } from "lodash";
- import { notFound } from "next/navigation";
-
- type Props = {} & SearchParams;
-
- const materialSetting: React.FC<Props> = async ({ searchParams }) => {
- const type = TypeEnum.MATERIAL;
- const { t } = await getServerI18n(type);
- console.log(searchParams);
- const id = isString(searchParams["id"])
- ? parseInt(searchParams["id"])
- : undefined;
- console.log(id)
- if (!id) {
- notFound();
- }
- return (
- <>
- {/* <Typography variant="h4">{t("Create Material")}</Typography> */}
- <I18nProvider namespaces={[type]}>
- <CreateProductMaterial type={type} id={id} />
- </I18nProvider>
- </>
- );
- };
- export default materialSetting;
|