diff --git a/src/lib/components/assets/list/asset-list.svelte b/src/lib/components/assets/list/asset-list.svelte index ebbdb936..4f7d4802 100644 --- a/src/lib/components/assets/list/asset-list.svelte +++ b/src/lib/components/assets/list/asset-list.svelte @@ -1,15 +1,16 @@ @@ -28,19 +29,19 @@ {#if Object.values($assetGroups).flat(1).length} {#each Object.entries($assetGroups) as [name, assets] (name)} - {#each assets as asset (asset.path)} - {#key asset.sha} - {#await sleep(0) then} - - {/await} - {/key} - {/each} + + {#snippet renderItem(/** @type {Asset} */ asset)} + {#key asset.sha} + + {/key} + {/snippet} + {/each} diff --git a/src/lib/components/common/infinite-scroll.svelte b/src/lib/components/common/infinite-scroll.svelte new file mode 100644 index 00000000..037e5e21 --- /dev/null +++ b/src/lib/components/common/infinite-scroll.svelte @@ -0,0 +1,65 @@ + + + +{#each items.slice(0, loadedItemSize) as item (item[itemKey])} + {@render renderItem(item)} +{/each} + +{#if loading} +
+{/if} + + diff --git a/src/lib/components/common/listing-grid.svelte b/src/lib/components/common/listing-grid.svelte index 6fd124b8..8e705a9f 100644 --- a/src/lib/components/common/listing-grid.svelte +++ b/src/lib/components/common/listing-grid.svelte @@ -4,6 +4,7 @@ -->
- - - + {#await sleep(0) then} + + + + {/await}