{#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.showOnAsset || item.showOnAsset.includes($currentAssetName)} onComponentChosen(item)} /> {/if} {/each}