{#if photosQuery.isPending}
{:else if photosQuery.isError}
{:else if photos.length === 0}
{#if filters.section === "archive"}
{:else if filters.section === "review"}
{:else if filters.section === "hidden"}
{:else if filters.section === "heap"}
{:else}
{/if}
{:else}
{/if}
{/if}
{#each rows as row (row.kind === "header" ? `h:${row.key}` : `t:${row.photo.UID}`)}
{#if row.kind === "header"}
{#if photosQuery.isFetchingNextPage}
{row.label} {row.count}
{:else} {@const photo = row.photo} {@const i = row.tileIndex} {@const inWindow = i >= renderFirst && i <= renderLast}
{#if inWindow}
{@const sel =
selectedIds.has(photo.UID) ||
focusedUid === photo.UID}
onTileClick(e, photo.UID)}
onDblclick={(e) => onTileDblclick(e, photo.UID)}
/>
{/if}
{/if}
{/each}