{#each shapes as shape, index (index)} {#if shape.children} {:else if shape.text !== undefined} {shape.text} {/if} {/each}