import { faCheck, faHourglass, faTimes } from "@fortawesome/free-solid-svg-icons";
import { h } from "@stencil/core";
import { DataTestIdsEnum } from "../../../../../../../../constants/dataTestIds.enum";
import { getIconHtmlFromIconDefinition } from "../../../../../../../../utils/icons/getIconHtmlFromIconDefinition";
const iconData = {
    pending: faHourglass,
    success: faCheck,
    fail: faTimes,
    invalid: faTimes,
};
export class TransactionDetailsBody {
    constructor() {
        this.transactionClass = 'transaction-details-list-item';
    }
    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: '63db229f9212b526c51af5794f73fe5d692ba785', innerHTML: iconHtml, class: {
                'transaction-details-list-item-icon': true,
                'transaction-details-list-item-icon-success': this.status === 'success',
                'transaction-details-list-item-icon-pending': this.status === 'pending',
                'transaction-details-list-item-icon-fail': ['fail', 'invalid'].includes(this.status),
            } })), h("div", { key: '8b80e9da397502156aad952624a84ec6ac7cf4d8', class: "transaction-details-list-item-hash-index" }, this.index), h("div", { key: 'adcfb5ebc91710450bc5b8a4f5ae674fd89326aa', class: "transaction-details-list-item-hash-value" }, h("mvx-trim-text", { key: '833d1bec49c05fd44c0544c7005d788570cf62f6', text: this.hash })), h("mvx-explorer-link", { key: 'a2a1f0613cea1a79d96acd079e5e3d588d12549d', iconClass: "transaction-details-list-item-explorer-link-icon", link: this.link }), h("mvx-copy-button", { key: 'e415576cde575d90e674a6fd9571928d1b847788', iconClass: "transaction-details-list-item-copy-button-icon", text: this.hash })));
    }
    static get is() { return "mvx-transaction-toast-details-body"; }
    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",
                "attribute": "transaction-class",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false,
                "defaultValue": "'transaction-details-list-item'"
            },
            "status": {
                "type": "string",
                "attribute": "status",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "hash": {
                "type": "string",
                "attribute": "hash",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "link": {
                "type": "string",
                "attribute": "link",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            },
            "index": {
                "type": "string",
                "attribute": "index",
                "mutable": false,
                "complexType": {
                    "original": "string",
                    "resolved": "string",
                    "references": {}
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "reflect": false
            }
        };
    }
}
//# sourceMappingURL=transaction-toast-details-body.js.map
