import { jsx } from "react/jsx-runtime";
import { useFormContext, Controller } from "react-hook-form";
import { TimeRangePicker } from "../TimeRangePicker/index.mjs";
const FormTimeRangePicker = ({ name, rules, onChange, ...rest }) => {
  const { control } = useFormContext();
  return /* @__PURE__ */ jsx(
    Controller,
    {
      control,
      name,
      rules,
      render: ({ field }) => {
        const { onChange: handleChange, ...restField } = field;
        return /* @__PURE__ */ jsx(
          TimeRangePicker,
          {
            onChange: (e) => {
              handleChange(e);
              onChange == null ? void 0 : onChange(e);
            },
            ...restField,
            ...rest
          }
        );
      }
    }
  );
};
export {
  FormTimeRangePicker
};
