import { h } from "@stencil/core";
import { faTimes } from "@fortawesome/free-solid-svg-icons";
import classNames from "classnames";
import { getIconHtmlFromIconName } from "../../../../utils/icons/getIconHtmlFromIconName";
import { getIconHtmlFromIconDefinition } from "../../../../utils/icons/getIconHtmlFromIconDefinition";
import { DataTestIdsEnum } from "../../../../constants/dataTestIds.enum";
export class TransactionToastContent {
    constructor() {
        this.transactions = undefined;
        this.toastDataState = undefined;
        this.processedTransactionsStatus = undefined;
    }
    render() {
        const { icon, iconClassName, title, hasCloseButton } = this.toastDataState;
        let iconHtml = null;
        if (typeof icon === 'string') {
            iconHtml = getIconHtmlFromIconName(icon);
        }
        if (icon instanceof HTMLElement) {
            iconHtml = icon.outerHTML;
        }
        return (h("div", { key: 'a1f1d8b368b91f4e21ad7577472d56cc572554d6', class: "content", "data-testid": DataTestIdsEnum.transactionToastContent }, h("div", { key: '0ecef1658ddd3540a61cd1989ff5751e00cd6676', class: "content-left" }, h("div", { key: '05cabf1cac879eb2f55cee1c531327d960b50bc3', class: classNames('content-icon', iconClassName), innerHTML: iconHtml })), h("div", { key: '749ec666bde13109417b7adea951f1c9c13a57b1', class: "content-right" }, h("div", { key: '755662680e8b4758806950b6380617579a29442a', class: "content-heading" }, h("h5", { key: '5b2cc414aef6a6207237f346b0664d58796fb8bb', class: "content-heading-title", "data-testid": DataTestIdsEnum.transactionToastTitle }, title), hasCloseButton && h("button", { key: 'b1990cbd987c62e2cf0f25d80649d41d1ce47aea', onClick: () => this.deleteToast.emit(), type: "button", class: "icon-close", innerHTML: getIconHtmlFromIconDefinition(faTimes) })), h("div", { key: 'a1f5e680a171c3b1ef19cd10779aa063ed29aba2', class: "content-heading-title" }, h("transaction-toast-details", { key: '0b495ade2e5fca2e955f7f1951ca940d4d88ab1a', transactions: this.transactions, processedTransactionsStatus: this.processedTransactionsStatus })))));
    }
    static get is() { return "transaction-toast-content"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["transaction-toast-content.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["transaction-toast-content.css"]
        };
    }
    static get properties() {
        return {
            "transactions": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "ITransaction[]",
                    "resolved": "ITransaction[]",
                    "references": {
                        "ITransaction": {
                            "location": "import",
                            "path": "../../transaction-toast.type",
                            "id": "src/components/transaction-toast/transaction-toast.type.ts::ITransaction"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false
            },
            "toastDataState": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "IToastDataState",
                    "resolved": "IToastDataState",
                    "references": {
                        "IToastDataState": {
                            "location": "import",
                            "path": "../../transaction-toast.type",
                            "id": "src/components/transaction-toast/transaction-toast.type.ts::IToastDataState"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false
            },
            "processedTransactionsStatus": {
                "type": "string",
                "mutable": false,
                "complexType": {
                    "original": "string | JSX.Element",
                    "resolved": "Element | string",
                    "references": {
                        "JSX": {
                            "location": "import",
                            "path": "@stencil/core",
                            "id": "node_modules::LocalJSX"
                        }
                    }
                },
                "required": false,
                "optional": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false,
                "attribute": "processed-transactions-status",
                "reflect": false
            }
        };
    }
    static get events() {
        return [{
                "method": "deleteToast",
                "name": "deleteToast",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "complexType": {
                    "original": "void",
                    "resolved": "void",
                    "references": {}
                }
            }];
    }
}
//# sourceMappingURL=transaction-toast-content.js.map
