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 SimpleToast {
    render() {
        const { icon, iconClassName, title, message, subtitle } = this.toast;
        let iconHtml = null;
        if (typeof icon === 'string') {
            iconHtml = getIconHtmlFromIconName(icon);
        }
        if (icon instanceof HTMLElement) {
            iconHtml = icon.outerHTML;
        }
        return (h("transaction-toast-wrapper", { key: 'b79c118d8a28a157a218a2f4c6ab8ba686946ffc', wrapperId: `toast-${this.toast.toastId}` }, h("div", { key: '4cfb85181d27e83293c7ed3b0a9168c98c25a9a5', class: "content", "data-testid": DataTestIdsEnum.transactionToastContent }, iconHtml && (h("div", { key: 'e32c45c0694ec2d35708f34d95f5233605acbb9c', class: classNames('content-left', { 'no-icon': !iconHtml }) }, h("div", { key: '16f955af8b3a75d1306ccb154b69bb49d422a1c3', class: classNames('content-icon', iconClassName), innerHTML: iconHtml }))), h("div", { key: '5783e33fe5dc213a28d6e79f6a0ed438a79a71dc', class: "content-right" }, title && (h("div", { key: '6892ba1211477cbce6fcaa0a3cba772b7da9b44b', class: "content-heading" }, h("h5", { key: '6ad6f17ef1af5783b73e2397695a50f106f48ee8', class: "content-heading-title", "data-testid": DataTestIdsEnum.transactionToastTitle }, title))), h("button", { key: '655417f3dbe06030e18f952e331c0ef34e2b988b', onClick: () => this.handleDeleteToast.emit(), type: "button", class: "icon-close", innerHTML: getIconHtmlFromIconDefinition(faTimes) }), subtitle && h("div", { key: '717138d27cdf1d58584c6de602d9729c6856d6f2', class: "subtitle" }, subtitle), message && h("div", { key: '641a386123fdd30f98c1a486eafc9fb9926ac6eb', class: classNames('content-message', { 'no-margin': !title && !subtitle }) }, message)))));
    }
    static get is() { return "simple-toast"; }
    static get encapsulation() { return "shadow"; }
    static get originalStyleUrls() {
        return {
            "$": ["simple-toast.css"]
        };
    }
    static get styleUrls() {
        return {
            "$": ["simple-toast.css"]
        };
    }
    static get properties() {
        return {
            "toast": {
                "type": "unknown",
                "mutable": false,
                "complexType": {
                    "original": "ISimpleToast",
                    "resolved": "ISimpleToast",
                    "references": {
                        "ISimpleToast": {
                            "location": "import",
                            "path": "components/functional/toasts-list/components/transaction-toast/transaction-toast.type",
                            "id": "src/components/functional/toasts-list/components/transaction-toast/transaction-toast.type.ts::ISimpleToast"
                        }
                    }
                },
                "required": false,
                "optional": false,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "getter": false,
                "setter": false
            }
        };
    }
    static get events() {
        return [{
                "method": "handleDeleteToast",
                "name": "handleDeleteToast",
                "bubbles": true,
                "cancelable": true,
                "composed": true,
                "docs": {
                    "tags": [],
                    "text": ""
                },
                "complexType": {
                    "original": "void",
                    "resolved": "void",
                    "references": {}
                }
            }];
    }
}
//# sourceMappingURL=simple-toast.js.map
