{#if showPill && activeIndex >= 0}
{/if} {#each items as item, index} {@const isActive = index === activeIndex} {@const isHovered = index === hoveredIndex} {#if variant === 'navigation' && item.href}
(hoveredIndex = index)} onmouseleave={() => (hoveredIndex = -1)} > {#if children} {@render children({ item, index, isActive, isHovered })} {:else}
{item.label}
{/if}
{:else}
handleItemClick(item, index)} onmouseenter={() => (hoveredIndex = index)} onmouseleave={() => (hoveredIndex = -1)} > {#if children} {@render children({ item, index, isActive, isHovered })} {:else}
{item.label}
{/if}
{/if} {/each}