import { faCheck, faCircleNotch, faTimes } from "@fortawesome/free-solid-svg-icons";
import { h } from "@stencil/core";
import classNames from "classnames";
import { DataTestIdsEnum } from "../../../../../../../../constants/dataTestIds.enum";
import { getIconHtmlFromIconDefinition } from "../../../../../../../../utils/icons/getIconHtmlFromIconDefinition";
const iconData = {
    pending: faCircleNotch,
    success: faCheck,
    fail: faTimes,
    invalid: faTimes,
};
export class TransactionDetailsBody {
    constructor() {
        this.transactionClass = 'transaction-container';
    }
    render() {
        const statusIcon = this.status ? iconData[this.status] : null;
        const iconHtml = statusIcon ? getIconHtmlFromIconDefinition(statusIcon) : null;
        return (h("div", { class: this.transactionClass, key: this.hash, "data-testid": DataTestIdsEnum.transactionDetailsToastBody }, iconHtml && (h("div", { key: '5eb0003b6a2a23eb70c8a67b803f493789401efd', innerHTML: iconHtml, class: classNames('icon', {
                'fa-spin': this.status === 'pending',
            }) })), h("span", { key: '11ccb326c2dc72c0c7842424bb5c3877d2dc798e', class: "trim" }, h("trim-text", { key: 'f18f56c4203434db610218412bc334cc23e31d2e', text: this.hash })), h("div", { key: '4487ebba20f61b7d2bab255a4487e776644dabf9', class: "actions" }, h("copy-button", { key: '9044fc3a2b81378e56f2fc7839b06ee3e6f262c3', text: this.hash }), h("explorer-link", { key: 'd0c31d34a021b7eb2c90344a517d14f145698c42', link: this.link }))));
    }
    static get is() { return "transaction-toast-details-body"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["transaction-toast-details-body.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["transaction-toast-details-body.css"]
        };
    }
    static get properties() {
        return {
            "transactionClass": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "transaction-class",
                "reflect": false,
                "defaultValue": "'transaction-container'"
            },
            "status": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "status",
                "reflect": false
            },
            "hash": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "hash",
                "reflect": false
            },
            "link": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "link",
                "reflect": false
            }
        };
    }
}
//# sourceMappingURL=transaction-toast-details-body.js.map
