import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import _extends from "@babel/runtime/helpers/extends";
import React, { Component } from "react";
import { createMenuByBehaviorType } from "./comfn";
import CBehaviorSetter from "../../../../cBehavior-setter";
var ActionSetterPanel = function ActionSetterPanel(props) {
  var current = props.current,
    onChange = props.onChange;
  var onConditionChange = function onConditionChange(data) {
    var obj = _extends({}, current, {
      config: data,
      menus: createMenuByBehaviorType(data.type)
    });
    onChange(obj);
  };
  return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(CBehaviorSetter, {
    value: current.config,
    onChange: onConditionChange
  }));
};
var _default = /*#__PURE__*/function (_Component) {
  function _default() {
    return _Component.apply(this, arguments) || this;
  }
  _inheritsLoose(_default, _Component);
  var _proto = _default.prototype;
  _proto.render = function render() {
    return /*#__PURE__*/React.createElement(ActionSetterPanel, this.props);
  };
  return _default;
}(Component);
export { _default as default };