{#if tree?.items?.length && level < 3}
{#each tree.items as item, index (index)} {@const active = tocState.isActive(item)}
tick().then(() => closePopover())} href={item.url} class={cn( "hover:text-foreground ml-5 inline-block py-0.5 pb-2 no-underline transition-colors", active ? "text-foreground" : "text-muted-foreground", tocState.isLastItem(item) && "pb-0" )} > {item.title}
{#if item.items?.length}
{/if}
{/each}
{/if}