import { SearchParams } from "@/app/utils/fetchUtil"; import { I18nProvider, getServerI18n } from "@/i18n"; import { Typography } from "@mui/material"; import isString from "lodash/isString"; import { notFound } from "next/navigation"; import { Suspense } from "react"; import EditPrinter from "@/components/EditPrinter"; import { fetchPrinterDetails } from "@/app/api/settings/printer/actions"; type Props = {} & SearchParams; const EditPrinterPage: React.FC = async ({ searchParams }) => { const { t } = await getServerI18n("common"); const id = isString(searchParams["id"]) ? parseInt(searchParams["id"]) : undefined; if (!id) { notFound(); } const printer = await fetchPrinterDetails(id); if (!printer) { notFound(); } return ( <> {t("Edit")} {t("Printer")} Loading...}> ); }; export default EditPrinterPage;