The two pages matched line for line apart from the noun, the filter field and the sort key: the count, the quick filter, the lettered grid paged as you scroll, the admin and listener empty states, and the "search the full library" link when the filter matches nothing loaded. AlphaLibrary now draws them once and each page supplies its query, noun, match, key and card. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
853 B
Svelte
27 lines
853 B
Svelte
<script lang="ts">
|
|
import { pageTitle } from '#lib/branding.js';
|
|
import { createAlbumsAlphaInfiniteQuery } from '#lib/api/albums.js';
|
|
import AlbumCard from '#lib/components/AlbumCard.svelte';
|
|
import AlphaLibrary from '#lib/components/AlphaLibrary.svelte';
|
|
import type { AlbumRef } from '#lib/api/types.js';
|
|
|
|
const queryStore = createAlbumsAlphaInfiniteQuery();
|
|
const query = $derived($queryStore);
|
|
</script>
|
|
|
|
<svelte:head><title>{pageTitle('Library · Albums')}</title></svelte:head>
|
|
|
|
<AlphaLibrary
|
|
{query}
|
|
title="Albums"
|
|
one="album"
|
|
many="albums"
|
|
matches={(a: AlbumRef, q) => a.title.toLowerCase().includes(q) || a.artist_name.toLowerCase().includes(q)}
|
|
getKey={(a: AlbumRef) => a.sort_title || a.title}
|
|
searchPath="/search/albums"
|
|
>
|
|
{#snippet item(album: AlbumRef)}
|
|
<AlbumCard {album} />
|
|
{/snippet}
|
|
</AlphaLibrary>
|