From 941e8eb10c7e9cef883fbbc283f154f3312f0f9b Mon Sep 17 00:00:00 2001 From: Joris Date: Tue, 12 Sep 2023 22:42:49 +0200 Subject: Show book summary in detail modal --- src/view/books.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/view') diff --git a/src/view/books.ts b/src/view/books.ts index 4229774..7cb3cc1 100644 --- a/src/view/books.ts +++ b/src/view/books.ts @@ -49,9 +49,16 @@ function bookDetailModal({ book, onClose }: BookDetailModalParams): Html { body: h('div', { className: 'g-BookDetail' }, h('img', { src: book.cover }), - h('dl', - metadata('Auteur', book.authors), - metadata('Genre', book.genres) + h('div', + h('dl', + metadata('Auteur', book.authors), + metadata('Genre', book.genres) + ), + book.summary && book.summary + .split('\n') + .map(str => str.trim()) + .filter(str => str != '') + .map(str => h('p', str)) ) ), onClose -- cgit v1.2.3