import { preloadBomCombo } from "@/app/api/bom";
import JodetailSearchWrapper from "@/components/Jodetail/FinishedGoodSearchWrapper";
import GeneralLoading from "@/components/General/GeneralLoading";
import PageTitleBar from "@/components/PageTitleBar";
import { I18nProvider, getServerI18n } from "@/i18n";
import { Metadata } from "next";
import React, { Suspense } from "react";

export const metadata: Metadata = {
  title: "Job Order Pick Execution",
};

const Jodetail: React.FC = async () => {
  const { t } = await getServerI18n("jo");

  preloadBomCombo();

  return (
    <>
      <PageTitleBar title={t("Job Order Pick Execution")} className="mb-4" />
      <I18nProvider namespaces={["jo", "common", "pickOrder"]}>
        <Suspense fallback={<GeneralLoading />}>
          <JodetailSearchWrapper />
        </Suspense>
      </I18nProvider>
    </>
  );
};

export default Jodetail;