use #tag to filter by tag

{#each categories as cat} {@const catNotes = filteredByCategory(cat)} {#if catNotes.length > 0}

/{cat}

{catNotes.length} note{catNotes.length !== 1 ? "s" : ""}
{/if} {/each}
{#if visibleCount === 0}
no results.
{/if}

{visibleCount} note{visibleCount !== 1 ? "s" : ""} total