import { jsx } from "react/jsx-runtime";
import { DSComboBox } from "@elliemae/ds-form";
import {
  Controller
} from "react-hook-form";
const ComboBox = ({
  name,
  defaultValue = "",
  rules = {},
  ...rest
}) => /* @__PURE__ */ jsx(
  Controller,
  {
    name,
    rules,
    defaultValue,
    render: ({ field: { onChange, ...props } }) => /* @__PURE__ */ jsx(
      DSComboBox,
      {
        ...rest,
        ...props,
        onChange: (selected) => {
          const { value = selected } = selected || {};
          onChange(value);
        }
      }
    )
  }
);
export {
  ComboBox
};
