"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Icon = void 0;
const react_1 = __importDefault(require("react"));
const Icon = ({ backgroundColor, label = '', icon, color, imgSrc, iconSize, className, iconOnly, }) => {
    const iconWithText = icon && label && !iconOnly
        ? 'icon-text'
        : imgSrc && label
            ? 'img-icon-text'
            : null;
    const fontIcon = icon ? (react_1.default.createElement("i", { style: { fontSize: iconSize }, className: icon })) : null;
    const imgIcon = imgSrc ? (react_1.default.createElement("img", { style: { width: iconSize }, src: imgSrc, alt: "", loading: "lazy" })) : null;
    const wBackgroundColor = backgroundColor ? 'has-bg-color' : null;
    return (react_1.default.createElement("span", { className: [className, 'on-icon', iconWithText, wBackgroundColor].join(' '), style: { backgroundColor, color }, role: "img", "aria-label": label.toString() },
        imgIcon,
        fontIcon,
        iconOnly ? null : label));
};
exports.Icon = Icon;
