import { h } from "@stencil/core";
import { getIconHtmlFromIconDefinition } from "../../../utils/icons/getIconHtmlFromIconDefinition";
import { getIconHtmlFromIconName } from "../../../utils/icons/getIconHtmlFromIconName";
export class FaIcon {
    constructor() {
        this.class = 'fa-icon';
    }
    render() {
        if (!this.icon) {
            return null;
        }
        const iconHtml = typeof this.icon === 'string' ? getIconHtmlFromIconName(this.icon) : getIconHtmlFromIconDefinition(this.icon);
        return h("i", { class: this.class, innerHTML: iconHtml, title: this.description });
    }
    static get is() { return "mvx-fa-icon"; }
    static get originalStyleUrls() {
        return {
            "$": ["fa-icon.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["fa-icon.css"]
        };
    }
    static get properties() {
        return {
            "class": {
                "type": "string",
                "attribute": "class",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "'fa-icon'"
            },
            "icon": {
                "type": "string",
                "attribute": "icon",
                "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,
                "reflect": false
            },
            "description": {
                "type": "string",
                "attribute": "description",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            }
        };
    }
}
//# sourceMappingURL=fa-icon.js.map
