feat(SampleList): remove text loader and add a prop isLoading

This commit is contained in:
Ilia Mashkov
2026-02-06 12:05:29 +03:00
parent 9167629616
commit 88f4cd97f9

View File

@@ -50,11 +50,9 @@ const displayRange = $derived.by(() => {
const loadedCount = Math.min(offset + limit, total); const loadedCount = Math.min(offset + limit, total);
return `Showing ${loadedCount} of ${total} fonts`; return `Showing ${loadedCount} of ${total} fonts`;
}); });
</script>
{#if unifiedFontStore.isFetching || unifiedFontStore.isLoading} const isLoading = $derived(unifiedFontStore.isFetching || unifiedFontStore.isLoading);
<span class="ml-2 text-xs text-muted-foreground/70">(Loading...)</span> </script>
{/if}
<FontVirtualList <FontVirtualList
items={unifiedFontStore.fonts} items={unifiedFontStore.fonts}
@@ -63,8 +61,15 @@ const displayRange = $derived.by(() => {
itemHeight={280} itemHeight={280}
useWindowScroll={true} useWindowScroll={true}
weight={controlManager.weight} weight={controlManager.weight}
{isLoading}
> >
{#snippet children({ item: font, isFullyVisible, isPartiallyVisible, proximity, index })} {#snippet children({
item: font,
isFullyVisible,
isPartiallyVisible,
proximity,
index,
})}
<FontListItem {font} {isFullyVisible} {isPartiallyVisible} {proximity}> <FontListItem {font} {isFullyVisible} {isPartiallyVisible} {proximity}>
<FontSampler {font} bind:text {index} /> <FontSampler {font} bind:text {index} />
</FontListItem> </FontListItem>