{#each categories as category, idx}
onCategoryChosen(category, idx)} class:active={idx === selectedIndex}> {#if category.icon}{/if} {category.name} {#if category.isCategory}{/if}
{/each}
(selectedIndex = null)} bind:this={popover} {anchor} align="left"> {#each categories[selectedIndex].children as item} {#if !item.showOnPages || item.showOnPages.includes($store.currentPageName)} onComponentChosen(item)} /> {/if} {/each}