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 { Badge } from '$lib/components/ui/badge/index.js';
import { Button } from '$lib/components/ui/button/index.js';
import BookImage from '$lib/components/view/book-image.svelte';
import GeneratedCover from '$lib/components/view/generated-cover.svelte';
import { dismissDuplicateBooks } from '$lib/api/book.remote';
import MergeBooks from '$lib/components/forms/merge-books/merge-books.svelte';
import type { Book, DuplicateBookGroup } from '$lib/schema';
@@ -134,6 +135,17 @@
>
{#if book.cover_image}
<BookImage src="/api/{book.cover_image}" class="h-full w-full object-cover" />
{:else}
<!-- A blank swatch here is worse than anywhere else: this screen
is a side-by-side comparison, and two of them are impossible
to tell apart. The candidate carries author names rather than
records, which is all the cover draws. -->
<GeneratedCover
book={{
title: book.title,
authors: book.authors.map((name) => ({ name }))
}}
/>
{/if}
</span>