🥅 add error-handling for shelf/nightstand

Signed-off-by: SindreKjelsrud <sindre@kjelsrud.dev>
This commit is contained in:
Sid 2024-07-29 21:30:40 +02:00
parent 22eb06b47a
commit cb37a740f4
Signed by: sidski
GPG key ID: D2BBDF3EDE6BA9A6

View file

@ -41,16 +41,24 @@ const sortedYears = Object.keys(booksByYear).sort((a: any, b: any) => b - a);
<h1 class="text-3xl font-extrabold">📚 ¿Dónde está la biblioteca?</h1>
<h2 class="text-xl font-semibold">on the shelf</h2>
<ul class="flex flex-col text-s gap-2 text-l">
{booksShelf.map((book) => (
{booksShelf.length !== 0 ? (
booksShelf.map((book) => (
<li class="borderbottom">📚 {book.title}</li>
))}
))
) : (
<p>currently empty...</p>
)}
</ul>
<h2 class="text-xl font-semibold">on the nightstand</h2>
<ul>
{booksReading.map((book) => (
<li class="borderbottom">📖 {book.title}</li>
))}
<ul class="flex flex-col text-s gap-2 text-l">
{booksReading.length !== 0 ? (
booksReading.map((book) => (
<li class="borderbottom">📖 {book.title}</li>
))
) : (
<p>currently empty...</p>
)}
</ul>
{sortedYears.map(year => (