"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.transformSmartLinkSizeToIconTileSize = exports.renderIconTile = exports.renderIconPerSize = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
var _react = _interopRequireDefault(require("react"));
var _icon = require("@atlaskit/icon");
var _constants = require("../../../constants");
var _utils = require("../../../utils");
var _excluded = ["size"],
  _excluded2 = ["size"];
var transformSmartLinkSizeToIconTileSize = exports.transformSmartLinkSizeToIconTileSize = function transformSmartLinkSizeToIconTileSize(size) {
  switch (size) {
    case _constants.SmartLinkSize.XLarge:
    case _constants.SmartLinkSize.Large:
      return '24';
    default:
      return '16';
  }
};
var renderIconPerSize = exports.renderIconPerSize = function renderIconPerSize(IconSmall, IconLarge) {
  return function (_ref) {
    var size = _ref.size,
      props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
    if ((0, _utils.isIconSizeLarge)(size)) {
      return /*#__PURE__*/_react.default.createElement(IconLarge, props);
    }
    return /*#__PURE__*/_react.default.createElement(IconSmall, props);
  };
};
var renderIconTile = exports.renderIconTile = function renderIconTile(Icon, appearance) {
  return function (_ref2) {
    var size = _ref2.size,
      props = (0, _objectWithoutProperties2.default)(_ref2, _excluded2);
    return /*#__PURE__*/_react.default.createElement(_icon.IconTile, (0, _extends2.default)({
      appearance: appearance,
      icon: Icon,
      size: transformSmartLinkSizeToIconTileSize(size)
    }, props));
  };
};