aboutsummaryrefslogtreecommitdiff
path: root/src/view/books.ts
diff options
context:
space:
mode:
authorJoris2023-09-12 22:42:49 +0200
committerJoris2023-09-12 22:42:49 +0200
commit941e8eb10c7e9cef883fbbc283f154f3312f0f9b (patch)
tree59dfc87273ada206e24643b450388391be1b10dc /src/view/books.ts
parent327f59797558343e00abe761d92c55e4e32347bb (diff)
Show book summary in detail modal
Diffstat (limited to 'src/view/books.ts')
-rw-r--r--src/view/books.ts13
1 files changed, 10 insertions, 3 deletions
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