{#if root} {#each children as child (child.id)} {#if Array.isArray(child.children)} {:else} {/if} {/each} {:else}