"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const theme_1 = require("../../gravity-blocks/context/theme/index.js");
const utils_1 = require("../../utils/index.js");
const Icon_1 = tslib_1.__importDefault(require("../Icon/Icon.js"));
function isIconSvg(icon) {
    return typeof icon === 'function';
}
const ContentIcon = ({ icon, className, qa, gravityIcon }) => {
    const theme = (0, theme_1.useTheme)();
    const iconThemed = (0, utils_1.getThemedValue)(icon, theme);
    const gravityIconThemed = (0, utils_1.getThemedValue)(gravityIcon, theme);
    if (iconThemed && isIconSvg(iconThemed)) {
        const IconComponent = iconThemed;
        return ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(IconComponent, { className: className }) }));
    }
    return (0, jsx_runtime_1.jsx)(Icon_1.default, { icon: iconThemed, gravityIcon: gravityIconThemed, className: className, qa: qa });
};
exports.default = ContentIcon;
//# sourceMappingURL=ContentIcon.js.map
