import React from "react";
import { DetailedScheduleLoading } from "./DetailedScheduleLoading";
import DSOverview from "./DetailedScheduleSearchView";
import { ScheduleType } from "@/app/api/scheduling";
import { SearchProdSchedule } from "@/app/api/scheduling/actions";

interface SubComponents {
  Loading: typeof DetailedScheduleLoading;
}

type Props = {
  type: ScheduleType;
};

const DetailedScheduleWrapper: React.FC<Props> & SubComponents = async ({
  type,
}) => {
  const defaultInputs: SearchProdSchedule = {
    types: ["detailed", "manual"],
  };

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

DetailedScheduleWrapper.Loading = DetailedScheduleLoading;

export default DetailedScheduleWrapper;
