Skip to content

Commit

Permalink
🥅 add error-handling for shelf/nightstand
Browse files Browse the repository at this point in the history
Signed-off-by: SindreKjelsrud <sindre@kjelsrud.dev>
  • Loading branch information
SindreKjelsrud committed Jul 29, 2024
1 parent 22eb06b commit cb37a74
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions src/pages/logs/bookshelf.astro
Original file line number Diff line number Diff line change
Expand Up @@ -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 => (
Expand Down

0 comments on commit cb37a74

Please sign in to comment.