import { 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";
import { getIconHtmlFromIconName } from "../../../../../../../utils/icons/getIconHtmlFromIconName";
export class TransactionToastContent {
    handleDeleteToast() {
        this.deleteToast.emit();
    }
    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: '272a0b2e0b12941a69c205e0de247f06a0b69497', class: "content", "data-testid": DataTestIdsEnum.transactionToastContent }, h("div", { key: '3c88c7553415a66bb4de14e4ea54fd85722ab89b', class: "content-left" }, h("div", { key: '3bb28edcdd0a9caf307d4c05fef328b00ee3ec4d', class: classNames('content-icon', iconClassName), innerHTML: iconHtml })), h("div", { key: 'b42bb2f2390d9eccac74854727f2010b958c5533', class: "content-right" }, h("div", { key: '3cca3eb7037588d171d4c8ecd720242b2278cadb', class: "content-heading" }, h("h5", { key: 'be550bbed4d3f1c7f752d8b762cfc2bd3b517ebe', class: "content-heading-title", "data-testid": DataTestIdsEnum.transactionToastTitle }, title), hasCloseButton && h("button", { key: '349c4c22ea092dc731bc92dd2b954af98f35475a', onClick: this.handleDeleteToast.bind(this), type: "button", class: "icon-close", innerHTML: getIconHtmlFromIconDefinition(faTimes) })), h("div", { key: 'a89fad6b4f2da35b6d9a628446adfe70d235fbdb', class: "content-heading-title" }, h("transaction-toast-details", { key: '94a907f15061c053c1db9223153fb8885745b2f8', 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/functional/toasts-list/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/functional/toasts-list/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
