"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.TextWithIcon = TextWithIcon;

var _react = _interopRequireDefault(require("react"));

var _classnames = _interopRequireDefault(require("classnames"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

// AKA Old Iconsides
function TextWithIcon(_ref) {
  var text = _ref.text,
      Icon = _ref.Icon,
      _ref$direction = _ref.direction,
      direction = _ref$direction === void 0 ? 'right' : _ref$direction,
      _ref$iconSide = _ref.iconSide,
      iconSide = _ref$iconSide === void 0 ? 'left' : _ref$iconSide,
      className = _ref.className,
      userSuppliedIconClassName = _ref.iconClassName;
  var iconClassName = "oec-text-with-icon__icon oec-text-with-icon__icon--direction-".concat(direction, " oec-text-with-icon__icon--side-").concat(iconSide);

  var icon = /*#__PURE__*/_react.default.createElement(Icon, {
    className: (0, _classnames.default)(iconClassName, userSuppliedIconClassName)
  });

  return /*#__PURE__*/_react.default.createElement("span", {
    className: (0, _classnames.default)('oec-text-with-icon', className)
  }, icon && iconSide === 'left' && icon, text, icon && iconSide === 'right' && icon);
}