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";

/* jscs:disable disallowDanglingUnderscores */
import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
export var Icon =
/*#__PURE__*/
function (_React$Component) {
  _inheritsLoose(Icon, _React$Component);

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

  var _proto = Icon.prototype;

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

    var iconName = name;
    var iconClassName = classnames('rc-icon', 'rc-icon-' + name, className);

    if (iconName) {
      return React.createElement("span", _extends({
        "data-test-automation-id": testAutomationId,
        className: iconClassName,
        "aria-hidden": ariaHidden
      }, props));
    } else {
      return null;
    }
  };

  return Icon;
}(React.Component);

_defineProperty(Icon, "propTypes", {
  testAutomationId: PropTypes.string,
  className: PropTypes.string,
  name: PropTypes.string.isRequired,
  ariaHidden: PropTypes.string
});

_defineProperty(Icon, "defaultProps", {
  className: null,
  testAutomationId: 'icon',
  ariaHidden: 'true'
});