- {#each groups as group (group.key)}
-
- {group.label} {group.photos.length}
-
- {#if layoutMode === 'justified' && gridWidth > 0}
- {#each justifiedRows(group.photos, gridWidth) as row, ri (group.key + '-' + ri)}
-
- {#each row.tiles as cell (cell.file.id)}
- {@render tile(cell.file, `width:${cell.w}px;height:${cell.h}px`)}
- {/each}
-
- {/each}
- {:else}
-
- {#each group.photos as photo (photo.id)}
- -
- {@render tile(photo)}
-
- {/each}
-
- {/if}
- {/each}
+ {#if photoRows.length}
+
+ {#snippet row(r)}
+ {#if r.kind === 'header'}
+
+ {r.label} {r.count}
+
+ {:else}
+
+ {#each r.tiles as cell (cell.file.id)}
+ {@render tile(cell.file, `width:${cell.w}px;height:${cell.h}px`)}
+ {/each}
+
+ {/if}
+ {/snippet}
+
+ {/if}