31 lines
607 B
Svelte
31 lines
607 B
Svelte
<script>
|
|
import AlbumCard from './AlbumCard.svelte';
|
|
import { Empty } from '$lib/components/ui';
|
|
|
|
/**
|
|
* @typedef {Object} AlbumListProps
|
|
* @property {import('$lib/api/types').Album[]} albums
|
|
*/
|
|
|
|
/** @type {AlbumListProps} */
|
|
let { albums } = $props();
|
|
</script>
|
|
|
|
{#if albums.length === 0}
|
|
<Empty message="暂无相册" icon="📁" />
|
|
{:else}
|
|
<div class="album-grid">
|
|
{#each albums as album (album.id)}
|
|
<AlbumCard {album} />
|
|
{/each}
|
|
</div>
|
|
{/if}
|
|
|
|
<style>
|
|
.album-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
|
|
gap: var(--space-lg);
|
|
}
|
|
</style>
|