const require_runtime = require("../../../../../_virtual/_rolldown/runtime.js");
let react = require("react");
react = require_runtime.__toESM(react);
let classnames = require("classnames");
classnames = require_runtime.__toESM(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 = (0, react.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.default.createElement("div", {
		className: (0, classnames.default)("text-card__icon", `text-card__icon--${position}`, className),
		style: iconStyle
	}, icon);
};
//#endregion
exports.default = IconWrapper;
