From b95a4577ac011a49e7ee77c316c1398322dc131a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20P=C4=99dzich?= Date: Sun, 22 Jan 2023 20:45:51 +0100 Subject: [PATCH] Implement responsive datatable variant --- .../[playlistId]/snapshots/[commitSha].astro | 42 ++++++++++++------- 1 file changed, 26 insertions(+), 16 deletions(-) diff --git a/src/pages/playlists/[playlistId]/snapshots/[commitSha].astro b/src/pages/playlists/[playlistId]/snapshots/[commitSha].astro index 4317cfe..f2df3a7 100644 --- a/src/pages/playlists/[playlistId]/snapshots/[commitSha].astro +++ b/src/pages/playlists/[playlistId]/snapshots/[commitSha].astro @@ -20,13 +20,13 @@ if (layoutProps.playlist) { ); if (!githubResponse.ok) { - throw new Error(githubResponse.status.toString()); + throw new Error(`GitHub ${githubResponse.status}`); } snapshot = (await githubResponse.json()) as PlaylistSnapshot; layoutProps.description = decode(snapshot.description, { level: 'html5' }); } catch (error) { - const isNotFoundError = (error as Error).message === '404'; + const isNotFoundError = (error as Error).message === 'GitHub 404'; layoutProps.errorOccurred = true; layoutProps.title = 'Error'; @@ -44,8 +44,7 @@ if (layoutProps.playlist) {

{layoutProps.description}

@@ -61,23 +60,28 @@ if (layoutProps.playlist) { snapshot?.tracks.map((track) => ( - - + + )) }
+ Title {track.name} - {track.artists.map((artist) => ( - - {artist.name} - - ))} + Artist(s) + + {track.artists.map((artist) => ( + + {artist.name} + + ))} + + Album {getFormattedDate(track.added_at)}{formatDuration(track.duration_ms)} + Date added + {getFormattedDate(track.added_at)} + + Duration + {formatDuration(track.duration_ms)} +