{#snippet LoadingIcon()} {#if loadingIcon}
{@render loadingIcon()}
{:else} {/if} {/snippet}
  • {#if closeButton && !toast.component && toastType !== 'loading' && closeIcon !== null} {/if} {#if toast.component} {@const Component = toast.component} {:else} {#if (toastType || toast.icon || toast.promise) && toast.icon !== null && (icon !== null || toast.icon)}
    {#if toast.promise || toastType === 'loading'} {#if toast.icon} {:else} {@render LoadingIcon()} {/if} {/if} {#if toast.type !== 'loading'} {#if toast.icon} {:else if toastType === 'success'} {@render successIcon?.()} {:else if toastType === 'error'} {@render errorIcon?.()} {:else if toastType === 'warning'} {@render warningIcon?.()} {:else if toastType === 'info'} {@render infoIcon?.()} {/if} {/if}
    {/if}
    {#if toast.title} {#if typeof toast.title !== 'string'} {@const Title = toast.title} {:else} {toast.title} {/if} {/if} </div> {#if toast.description} <div data-description="" class={cn( descriptionClass, toastDescriptionClass, classes?.description, toast.classes?.description )} > {#if typeof toast.description !== 'string'} {@const Description = toast.description} <Description {...toast.componentProps} /> {:else} {toast.description} {/if} </div> {/if} </div> {#if toast.cancel} {#if typeof toast.cancel === 'function'} <toast.cancel /> {:else if isAction(toast.cancel)} <button data-button data-cancel style={toast.cancelButtonStyle ?? cancelButtonStyle} class={cn( classes?.cancelButton, toast?.classes?.cancelButton )} onclick={(event) => { if (!isAction(toast.cancel)) return; if (!dismissible) return; toast.cancel?.onClick?.(event); deleteToast(); }} > {toast.cancel.label} </button> {/if} {/if} {#if toast.action} {#if typeof toast.action === 'function'} <toast.action /> {:else if isAction(toast.action)} <button data-button="" style={toast.actionButtonStyle ?? actionButtonStyle} class={cn( classes?.actionButton, toast?.classes?.actionButton )} onclick={(event) => { if (!isAction(toast.action)) return; toast.action?.onClick(event); if (event.defaultPrevented) return; deleteToast(); }} > {toast.action.label} </button> {/if} {/if} {/if} </li>