import React, { useMemo } from "react";
import classNames from "classnames";
//#region src/components/PisellCards/components/TextCard/components/IconWrapper.tsx
/**
* IconWrapper 图标包装组件
* 负责统一图标渲染逻辑，支持自定义图标大小和颜色
*
* @example
* ```tsx
* <IconWrapper
*   icon={<BellIcon />}
*   position="prefix"
*   config={{ size: 16, color: '#666' }}
* />
* ```
*/
const IconWrapper = (props) => {
	const { icon, config, position, className } = props;
	/**
	* 计算图标样式
	* 支持自定义大小和颜色
	*/
	const iconStyle = useMemo(() => {
		const style = {};
		if (config === null || config === void 0 ? void 0 : config.size) style.fontSize = config.size;
		if (config === null || config === void 0 ? 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--${position}`, className),
		style: iconStyle
	}, icon);
};
//#endregion
export { IconWrapper as default };
