var _excluded = ["aria-label", "href", "children"],
  _excluded2 = ["aria-label", "children"];
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
import React from 'react';
import { StyledAnchor, StyledUnstyledButton } from '../Semantic/Semantic.styles';
import { Tooltip } from '../Tooltip/Tooltip';
var ActionIconLink = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
  var label = _ref['aria-label'],
    href = _ref.href,
    children = _ref.children,
    props = _objectWithoutProperties(_ref, _excluded);
  return /*#__PURE__*/React.createElement(Tooltip, {
    overlay: label,
    trigger: ['hover', 'focus']
  }, /*#__PURE__*/React.createElement(StyledAnchor, _extends({
    "aria-label": label,
    href: href
  }, props, {
    ref: ref
  }), children));
});
var ActionIconButton = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
  var label = _ref2['aria-label'],
    children = _ref2.children,
    props = _objectWithoutProperties(_ref2, _excluded2);
  return /*#__PURE__*/React.createElement(Tooltip, {
    overlay: label,
    trigger: ['hover', 'focus']
  }, /*#__PURE__*/React.createElement(StyledUnstyledButton, _extends({
    "aria-label": label
  }, props, {
    ref: ref
  }), children));
});
function ActionIconInner(props, ref) {
  if (props.role === 'link' || props.href) {
    return /*#__PURE__*/React.createElement(ActionIconLink, _extends({}, props, {
      ref: ref
    }));
  }
  if (props.role === 'button') {
    return /*#__PURE__*/React.createElement(ActionIconButton, _extends({}, props, {
      ref: ref
    }));
  }
  return /*#__PURE__*/React.createElement(ActionIconButton, _extends({}, props, {
    ref: ref
  }));
}
export var ActionIcon = /*#__PURE__*/React.forwardRef(ActionIconInner);
//# sourceMappingURL=ActionIcon.js.map