import { fetchAllItems } from "@/app/api/settings/item";
// import ItemsSearch from "./ItemsSearch";
// import ItemsSearchLoading from "./ItemsSearchLoading";
import { SearchParams } from "@/app/utils/fetchUtil";
import { TypeEnum } from "@/app/utils/typeEnum";
import { notFound } from "next/navigation";
import { fetchPoWithStockInLines, PoResult } from "@/app/api/po";
import { QcItemWithChecks } from "@/app/api/qc";
import { fetchWarehouseList } from "@/app/api/warehouse";
import { fetchQcItemCheck } from "@/app/api/qc/actions";
import PickOrderDetail from "./PickOrderDetail";
import PickOrderDetailLoading from "./PickOrderDetailLoading";

interface SubComponents {
  Loading: typeof PickOrderDetailLoading;
}

type Props = {
  consoCode: string;
};

const PoDetailWrapper: React.FC<Props> & SubComponents = async ({
  consoCode,
}) => {
  const [qc] = await Promise.all([fetchQcItemCheck()]);
  // const poWithStockInLine = await fetchPoWithStockInLines(id)

  return <PickOrderDetail consoCode={consoCode} qc={qc} />;
};

PoDetailWrapper.Loading = PickOrderDetailLoading;

export default PoDetailWrapper;
