import _extends from "@babel/runtime/helpers/extends";
import React from 'react';
import { IconTile } from '@atlaskit/icon';
import { SmartLinkSize } from '../../../constants';
import { isIconSizeLarge } from '../../../utils';
export const transformSmartLinkSizeToIconTileSize = size => {
  switch (size) {
    case SmartLinkSize.XLarge:
    case SmartLinkSize.Large:
      return '24';
    default:
      return '16';
  }
};
export const renderIconPerSize = (IconSmall, IconLarge) => {
  return ({
    size,
    ...props
  }) => {
    if (isIconSizeLarge(size)) {
      return /*#__PURE__*/React.createElement(IconLarge, props);
    }
    return /*#__PURE__*/React.createElement(IconSmall, props);
  };
};
export const renderIconTile = (Icon, appearance) => {
  return ({
    size,
    ...props
  }) => {
    return /*#__PURE__*/React.createElement(IconTile, _extends({
      appearance: appearance,
      icon: Icon,
      size: transformSmartLinkSizeToIconTileSize(size)
    }, props));
  };
};