import { preloadBomCombo } from "@/app/api/bom";
import JoSearch from "@/components/JoSearch";
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",
};

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

  preloadBomCombo();

  return (
    <>
      <PageTitleBar title={t("Search Job Order/ Create Job Order")} className="mb-4" />
      <I18nProvider namespaces={["jo", "common", "purchaseOrder", "dashboard"]}>
        <Suspense fallback={<JoSearch.Loading />}>
          <JoSearch />
        </Suspense>
      </I18nProvider>
    </>
  );
};

export default Jo;