feat: draw generated covers where a book has none

This commit is contained in:
2026-08-17 10:35:01 -04:00
parent 904d8fc76f
commit d16a90f08f
3 changed files with 27 additions and 3 deletions
@@ -10,6 +10,7 @@
import { Textarea } from '$lib/components/ui/textarea/index.js';
import { Badge } from '$lib/components/ui/badge/index.js';
import BookImage from '$lib/components/view/book-image.svelte';
import GeneratedCover from '$lib/components/view/generated-cover.svelte';
import { mergeBooks } from '$lib/api/book.remote';
import type { Book } from '$lib/schema';
@@ -132,6 +133,10 @@
<span class="{size} shrink-0 overflow-hidden rounded-sm border bg-muted">
{#if book.cover_image}
<BookImage src="/api/{book.cover_image}" class="h-full w-full object-cover" />
{:else}
<!-- Drawn rather than left blank, so the rail tells two coverless books
apart the same way the shelves do. -->
<GeneratedCover {book} />
{/if}
</span>
{/snippet}