import React from "react";
export 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.createElement("i", { style: { fontSize: iconSize }, className: icon })
        : null;
    const imgIcon = imgSrc
        ? React.createElement("img", { style: { width: iconSize }, src: imgSrc, alt: "", loading: "lazy" })
        : null;
    const wBackgroundColor = backgroundColor ? "has-bg-color" : null;
    return (React.createElement("span", { className: [className, "on-icon", iconWithText, wBackgroundColor].join(" "), style: { backgroundColor, color }, role: "img", "aria-label": label.toString() },
        imgIcon,
        fontIcon,
        iconOnly ? null : label));
};
