import { fetchAllItems } from "@/app/api/settings/item";
import { RoughScheduleLoading } from "./RoughScheduleLoading";
import RSOverview from "./RoughSchedileSearchView";
import {
  SearchProdSchedule
} from "@/app/api/scheduling/actions";
import { ScheduleType } from "@/app/api/scheduling";

interface SubComponents {
  Loading: typeof RoughScheduleLoading;
}

type Props = {
  type: ScheduleType;
};

const RoughScheduleWrapper: React.FC<Props> & SubComponents = async ({
  type,
}) => {
  // console.log(type)
  const defaultInputs: SearchProdSchedule = {
    types: ["rough"],
  };

  // const [
  // items,
  //   prodSchedules
  // ] = await Promise.all([
  // fetchAllItems(),
  //   fetchProdSchedules(defaultInputs)
  // ])

  return <RSOverview type={type} defaultInputs={defaultInputs} />;
};

RoughScheduleWrapper.Loading = RoughScheduleLoading;

export default RoughScheduleWrapper;
