import { _ as _extends } from '../_rollupPluginBabelHelpers-736b301a.js';
import React__default from 'react';
import { Tooltip } from 'antd';
import IconFont from '../IconFont/index.js';
import '@zenview/micro-utils';

/**
 * mode: horizontal(水平) vertical(默认上下)
 */
const IconSpan = ({
  className = '',
  onClick = null,
  icon = '',
  title = '',
  // Icon的title
  label = '',
  // 显示文本
  mode = 'vertical',
  children = null,
  disabled = false,
  detail,
  placement = 'bottom',
  ...rest
}) => {
  const modeClass = mode === 'vertical' ? 'icon-span-vertical' : 'icon-span-horizontal';
  const disabledClass = disabled ? 'disabled' : '';
  const content = /*#__PURE__*/React__default.createElement("span", _extends({
    className: `icon-span ${disabledClass} ${modeClass} ${className}`,
    onClick: !disabled ? onClick : null
  }, rest), icon && /*#__PURE__*/React__default.createElement(IconFont, {
    title: title,
    type: icon
  }), label && /*#__PURE__*/React__default.createElement("span", null, label), children);
  if (!detail) {
    return content;
  }
  return /*#__PURE__*/React__default.createElement(Tooltip, {
    placement: placement,
    title: detail
  }, content);
};

export { IconSpan as default };
//# sourceMappingURL=index.js.map
