{ if (!carriesFiles(event) || workspace.tree.query) return event.preventDefault() dropping = true }} ondragleave={(event) => { if (!(event.currentTarget as HTMLElement).contains(event.relatedTarget as Node | null)) dropping = false }} ondrop={drop} >
{workspace.tree.space?.slug ?? 'diary'} {items} {items === 1 ? 'item' : 'items'}{#if workspace.tree.foundCards.length > 0} · {workspace.tree.foundCards.length} {workspace.tree.foundCards.length === 1 ? 'card' : 'cards'}{/if}{#if workspace.tree.foundNotes.length > 0} · {workspace.tree.foundNotes.length} {workspace.tree.foundNotes.length === 1 ? 'note' : 'notes'}{/if}
{#if workspace.tree.query}
/{workspace.tree.query} {#if workspace.tree.globalSearch}all spaces{/if}
{/if}
    {#if nested}
  • {/if} {#each workspace.tree.nodes as node, index (node.id)} {@const previous = above(index)} {@const nested = workspace.tree.isNested(node)} {#if !workspace.tree.query && !nested && node.kind === 'document' && (!previous || previous.kind !== 'document' || formatDay(previous.created_at) !== formatDay(node.created_at))}
  • {formatDay(node.created_at)} {formatWeekday(node.created_at)}
  • {/if}
  • carry(event, node)} ondragend={release} {@attach into(isContainer(node) ? node.id : null, `into ${label(node)}`)} > {#if isTouchDevice} {/if}
  • {/each} {#if workspace.tree.foundCards.length > 0}
  • cards
  • {/if} {#each workspace.tree.foundCards as card, at (card.id)} {@const index = workspace.tree.nodes.length + at}
  • {/each} {#if workspace.tree.foundNotes.length > 0}
  • notes
  • {/if} {#each workspace.tree.foundNotes as note, at (note.id)} {@const index = workspace.tree.nodes.length + workspace.tree.foundCards.length + at}
  • {/each} {#if workspace.tree.rows === 0}
  • {#if workspace.tree.query} no matches {:else} nothing here yet — o writes, ⇧ O makes a folder, files dropped here land here {/if}
  • {/if}