{#snippet locationNode(location: Location, depth: number)} {@const children = getChildren(location.id)} {@const itemCount = getItemCount(location.id)} {@const isExpanded = expanded.has(location.id)} {@const isSelected = selectedId === location.id}
{:else} {/if} {location.name} {#if itemCount > 0} {itemCount} {/if}
{#if isExpanded && children.length > 0} {#each children as child} {@render locationNode(child, depth + 1)} {/each} {/if} {/snippet}
{#each roots as root} {@render locationNode(root, 0)} {/each} {#if roots.length === 0}

No locations configured

{/if}