import { type FC } from "react";
import type DateObject from "react-date-object";
import TaskDetailDateForm from "./TaskDetailDateForm";

type Props = {
  onClose: () => void;
  onSubmit: (data: { startDate: DateObject | null; endDate: DateObject | null }) => void;
  initialStartDate?: DateObject | null;
  initialEndDate?: DateObject | null;
  isSubmitting?: boolean;
};

const TaskDetailDatePopover: FC<Props> = ({
  onClose,
  onSubmit,
  initialStartDate,
  initialEndDate,
  isSubmitting,
}) => {
  return (
    <TaskDetailDateForm
      onClose={onClose}
      onSubmit={onSubmit}
      initialStartDate={initialStartDate}
      initialEndDate={initialEndDate}
      isSubmitting={isSubmitting}
    />
  );
};

export default TaskDetailDatePopover;
