import { h } from "@stencil/core";
import classNames from "classnames";
import { getIconHtmlFromIconDefinition } from "../../../utils/icons/getIconHtmlFromIconDefinition";
import { getIconHtmlFromIconName } from "../../../utils/icons/getIconHtmlFromIconName";
export class FaIcon {
    render() {
        if (!this.icon) {
            return null;
        }
        const iconHtml = typeof this.icon === 'string' ? getIconHtmlFromIconName(this.icon) : getIconHtmlFromIconDefinition(this.icon);
        return h("i", { class: classNames(this.class, 'fa-icon'), innerHTML: iconHtml, title: this.description });
    }
    static get is() { return "fa-icon"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["fa-icon.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["fa-icon.css"]
        };
    }
    static get properties() {
        return {
            "class": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "class",
                "reflect": false
            },
            "icon": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "IconDefinition | string",
                    "resolved": "IconDefinition | string",
                    "references": {
                        "IconDefinition": {
                            "location": "import",
                            "path": "@fortawesome/free-solid-svg-icons",
                            "id": "node_modules::IconDefinition"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "icon",
                "reflect": false
            },
            "description": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "description",
                "reflect": false
            }
        };
    }
}
//# sourceMappingURL=fa-icon.js.map
