{#if loading && !notes.length}
{:else if !notes.length}
{$i18n.t('No Notes')}
{#if canCreate}
{$i18n.t('New Note')}
{/if}
{:else} {@const groups = groupNotes(notes)}
{#each groups as [timeRange, notesList], idx (timeRange)}
{$i18n.t(timeRange)}
{#each notesList as note (note.id)}
open(href, note.title)} onChange={onReload} onDelete={note.user_id === $user?.id || $user?.role === 'admin' ? () => { deleting = note; showDelete = true; } : null} /> {/each}
{/each} {#if notes.length < total}
{/if}
{/if}