import React, { useMemo } from 'react';
import classNames from 'classnames';
/**
 * IconWrapper 图标包装组件
 * 负责统一图标渲染逻辑，支持自定义图标大小和颜色
 *
 * @example
 * ```tsx
 * <IconWrapper
 *   icon={<BellIcon />}
 *   position="prefix"
 *   config={{ size: 16, color: '#666' }}
 * />
 * ```
 */
var IconWrapper = function IconWrapper(props) {
  var icon = props.icon,
    config = props.config,
    position = props.position,
    className = props.className;

  /**
   * 计算图标样式
   * 支持自定义大小和颜色
   */
  var iconStyle = useMemo(function () {
    var style = {};
    if (config !== null && config !== void 0 && config.size) {
      style.fontSize = config.size;
    }
    if (config !== null && config !== void 0 && config.color) {
      style.color = config.color;
    }
    return style;
  }, [config === null || config === void 0 ? void 0 : config.size, config === null || config === void 0 ? void 0 : config.color]);
  return /*#__PURE__*/React.createElement("div", {
    className: classNames('text-card__icon', "text-card__icon--".concat(position), className),
    style: iconStyle
  }, icon);
};
export default IconWrapper;