›
{#each categories as cat} {@const catNotes = notes.filter( (n) => getCategory(n) === cat && matchesSearch(n), )} {#if catNotes.length > 0 || !search} {@const isFolder = notes.some((n) => n.id.includes("/") && getCategory(n) === cat)}
{#if isFolder} {cat} {:else} {cat} {/if}
{#if openCategories.includes(cat)}
    {#each catNotes as note}
  • {currentEntry && note.id === currentEntry.id ? "▸" : "–"} {note.data.title}
  • {/each}
{/if}
{/if} {/each}