{#snippet button(props = {})} { if (stopPropagationOnClick) e.stopPropagation(); onclick?.(e); }} {size} {variant} > {#if icon} {@const IconComponent = icon} {/if} {/snippet} {#if showTooltip} {#snippet child({ props })} {#if disabled} {@render button({})} {:else} {@render button(props)} {/if} {/snippet} {tooltip} {:else} {@render button({ href })} {/if}
{tooltip}