import { fetchPickOrders } from "@/app/api/pickOrder";
import GeneralLoading from "../General/GeneralLoading";
import PickOrderSearch from "./FinishedGoodSearch";
import{fetchPrinterCombo} from "@/app/api/settings/printer";
interface SubComponents {
  Loading: typeof GeneralLoading;
}

const FinishedGoodSearchWrapper: React.FC & SubComponents = async () => {
  const [pickOrders, printerCombo] = await Promise.all([
    fetchPickOrders({
      code: undefined,
      targetDateFrom: undefined,
      targetDateTo: undefined,
      type: undefined,
      status: undefined,
      itemName: undefined,
    }),
    fetchPrinterCombo(),
  ]);

  return <PickOrderSearch pickOrders={pickOrders} printerCombo={printerCombo} />;
};

FinishedGoodSearchWrapper.Loading = GeneralLoading;

export default FinishedGoodSearchWrapper;
