import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
import _inheritsLoose from "@babel/runtime/helpers/inheritsLoose";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import React from 'react';
import PropTypes from 'prop-types';
import BSDropdown from 'react-bootstrap/lib/Dropdown';
import { Icon } from './Icon';
export var CTADropdown =
/*#__PURE__*/
function (_React$Component) {
  _inheritsLoose(CTADropdown, _React$Component);

  function CTADropdown() {
    return _React$Component.apply(this, arguments) || this;
  }

  var _proto = CTADropdown.prototype;

  _proto.getChildContext = function getChildContext() {
    return {
      isCTADropdown: true
    };
  };

  _proto.render = function render() {
    var _this$props = this.props,
        testAutomationId = _this$props.testAutomationId,
        children = _this$props.children,
        toggleMoreLabel = _this$props.toggleMoreLabel,
        props = _objectWithoutPropertiesLoose(_this$props, ["testAutomationId", "children", "toggleMoreLabel"]);

    return React.createElement(BSDropdown, _extends({}, props, {
      pullRight: true,
      "data-test-automation-id": testAutomationId
    }), React.createElement(BSDropdown.Toggle, {
      "aria-label": toggleMoreLabel,
      noCaret: true
    }, React.createElement(Icon, {
      name: "more-vertical",
      className: "icon-dropdown-toggle-more"
    })), React.createElement(BSDropdown.Menu, null, children));
  };

  return CTADropdown;
}(React.Component);

_defineProperty(CTADropdown, "propTypes", {
  testAutomationId: PropTypes.string,
  children: PropTypes.node,
  toggleMoreLabel: PropTypes.string
});

_defineProperty(CTADropdown, "defaultProps", {
  testAutomationId: 'CATDropdown',
  children: null,
  toggleMoreLabel: 'TRANSLATE:MORE_SETTINGS'
});

_defineProperty(CTADropdown, "childContextTypes", {
  isCTADropdown: PropTypes.bool
});