import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import * as React from 'react';
import { block } from "../../utils/index.js";
import Image from "../Image/Image.js";
import { getMediaImage } from "../Media/Image/utils.js";
import './IconWrapper.css';
const b = block('icon-wrapper');
const IconWrapper = (props) => {
    const { icon, children, className } = props;
    if (!icon) {
        return _jsx(React.Fragment, { children: children });
    }
    const iconProps = getMediaImage(icon.value);
    const iconPosition = icon?.position;
    return (_jsxs("div", { className: b({ ['icon-position']: iconPosition }, className), children: [iconProps && (_jsx(Image, { ...iconProps, containerClassName: b('icon-container'), className: b('icon', { ['icon-position']: iconPosition }) })), _jsx("div", { className: b('content', { ['icon-position']: iconPosition }), children: children })] }));
};
export default IconWrapper;
//# sourceMappingURL=IconWrapper.js.map
