import { l as library$1, i as icon } from './getIconHtmlFromIconDefinition-qtCpOx4f.js';
import { s as solidIcons } from './index-Dk7zyo_j.js';

function getIconHtmlFromIconName(iconName) {
    let faIcon;
    const usedIconName = iconName.includes('fa') ? iconName : `fa${capitalize(iconName)}`;
    const dynamicIcon = solidIcons[usedIconName];
    if (!dynamicIcon) {
        console.error(`Icon "${iconName}" not found"`);
        return null;
    }
    library$1.add(dynamicIcon);
    faIcon = icon(dynamicIcon);
    return faIcon ? faIcon.html[0] : null;
}
function capitalize(iconName) {
    if (!iconName) {
        return iconName;
    }
    return iconName.charAt(0).toUpperCase() + iconName.slice(1);
}

export { getIconHtmlFromIconName as g };
//# sourceMappingURL=getIconHtmlFromIconName-NnMAPzcy.js.map

//# sourceMappingURL=getIconHtmlFromIconName-NnMAPzcy.js.map