aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/book.ts3
-rw-r--r--src/view/books.ts13
2 files changed, 12 insertions, 4 deletions
diff --git a/src/book.ts b/src/book.ts
index 328f8e1..680cc11 100644
--- a/src/book.ts
+++ b/src/book.ts
@@ -4,7 +4,8 @@ export interface Book {
authors: Array<string>
authorsSort: string
genres: Array<string>
- date: string
+ date: number
+ summary?: string
read: ReadStatus,
cover: string
}
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