"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const React = tslib_1.__importStar(require("react"));
const utils_1 = require("../../utils/index.js");
const Image_1 = tslib_1.__importDefault(require("../Image/Image.js"));
const utils_2 = require("../Media/Image/utils.js");
const b = (0, utils_1.block)('icon-wrapper');
const IconWrapper = (props) => {
    const { icon, children, className } = props;
    if (!icon) {
        return (0, jsx_runtime_1.jsx)(React.Fragment, { children: children });
    }
    const iconProps = (0, utils_2.getMediaImage)(icon.value);
    const iconPosition = icon?.position;
    return ((0, jsx_runtime_1.jsxs)("div", { className: b({ ['icon-position']: iconPosition }, className), children: [iconProps && ((0, jsx_runtime_1.jsx)(Image_1.default, { ...iconProps, containerClassName: b('icon-container'), className: b('icon', { ['icon-position']: iconPosition }) })), (0, jsx_runtime_1.jsx)("div", { className: b('content', { ['icon-position']: iconPosition }), children: children })] }));
};
exports.default = IconWrapper;
//# sourceMappingURL=IconWrapper.js.map
