FPSMS-frontend
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 

47 wiersze
1.4 KiB

  1. import { SearchParams } from "@/app/utils/fetchUtil";
  2. import DoDetail from "@/components/DoDetail/DoDetailWrapper";
  3. import PageTitleBar from "@/components/PageTitleBar";
  4. import { I18nProvider, getServerI18n } from "@/i18n";
  5. import { isArray } from "lodash";
  6. import { Metadata } from "next";
  7. import Link from "next/link";
  8. import { notFound } from "next/navigation";
  9. import { Suspense } from "react";
  10. export const metadata: Metadata = {
  11. title: "DO Workbench — Delivery Order Detail",
  12. };
  13. type Props = SearchParams;
  14. const Page: React.FC<Props> = async ({ searchParams }) => {
  15. const { t } = await getServerI18n("do");
  16. const id = searchParams["id"];
  17. if (!id || isArray(id) || !isFinite(parseInt(id))) {
  18. notFound();
  19. }
  20. return (
  21. <>
  22. <PageTitleBar title={t("Edit Delivery Order Detail")} className="mb-4" />
  23. <p className="mb-4 text-sm">
  24. <Link href="/doworkbench" className="text-primary underline">
  25. {t("DO Workbench", { defaultValue: "DO Workbench" })}
  26. </Link>
  27. {" · "}
  28. <Link href="/doworkbenchsearch" className="text-primary underline">
  29. {t("DO Workbench Search", { defaultValue: "DO Workbench Search" })}
  30. </Link>
  31. </p>
  32. <I18nProvider namespaces={["do", "common"]}>
  33. <Suspense fallback={<DoDetail.Loading />}>
  34. <DoDetail id={parseInt(id)} workbenchRelease />
  35. </Suspense>
  36. </I18nProvider>
  37. </>
  38. );
  39. };
  40. export default Page;