import { PreloadPickOrder } from "@/app/api/pickOrder";
import { SearchParams } from "@/app/utils/fetchUtil";
import PickOrderDetail from "@/components/PickOrderDetail";
import { getServerI18n, I18nProvider } from "@/i18n";
import { Stack, Typography } from "@mui/material";
import { Metadata } from "next";
import { Suspense } from "react";

export const metadata: Metadata = {
  title: "Consolidated Pick Order Flow",
};
type Props = {} & SearchParams;

const PickOrder: React.FC<Props> = async ({ searchParams }) => {
  const { t } = await getServerI18n("pickOrder");

  PreloadPickOrder();

  return (
    <>
      <I18nProvider namespaces={["pickOrder","navigation","common","purchaseOrder"]}>
        <Suspense fallback={<PickOrderDetail.Loading />}>
          <PickOrderDetail consoCode={`${searchParams["consoCode"]}`} />
        </Suspense>
      </I18nProvider>
    </>
  );
};

export default PickOrder;
