diff --git a/client/app/components/AllTimeStats.tsx b/client/app/components/AllTimeStats.tsx index 8f1bc40..556fa32 100644 --- a/client/app/components/AllTimeStats.tsx +++ b/client/app/components/AllTimeStats.tsx @@ -7,10 +7,12 @@ export default function AllTimeStats() { queryFn: ({ queryKey }) => getStats(queryKey[1]), }); + const header = "All time stats"; + if (isPending) { return (
-

All Time Stats

+

{header}

Loading...

); @@ -18,7 +20,7 @@ export default function AllTimeStats() { return ( <>
-

All Time Stats

+

{header}

Error: {error.message}

@@ -29,7 +31,7 @@ export default function AllTimeStats() { return (
-

All Time Stats

+

{header}

getNowPlaying(), }); + const header = "Last played"; + const [items, setItems] = useState(null); const handleDelete = async (listen: Listen) => { @@ -63,14 +65,14 @@ export default function LastPlays(props: Props) { if (isPending) { return (
-

Last Played

+

{header}

Loading...

); } else if (isError) { return (
-

Last Played

+

{header}

Error: {error.message}

); @@ -86,7 +88,7 @@ export default function LastPlays(props: Props) { return (

- Last Played + {header}

diff --git a/client/app/components/TopAlbums.tsx b/client/app/components/TopAlbums.tsx index 052e76a..d8a3b00 100644 --- a/client/app/components/TopAlbums.tsx +++ b/client/app/components/TopAlbums.tsx @@ -30,17 +30,19 @@ export default function TopAlbums(props: Props) { queryFn: ({ queryKey }) => getTopAlbums(queryKey[1] as getItemsArgs), }); + const header = "Top albums"; + if (isPending) { return (
-

Top Albums

+

{header}

Loading...

); } else if (isError) { return (
-

Top Albums

+

{header}

Error: {error.message}

); @@ -54,7 +56,7 @@ export default function TopAlbums(props: Props) { props.artistId ? `&artist_id=${props.artistId}` : "" }`} > - Top Albums + {header}
diff --git a/client/app/components/TopArtists.tsx b/client/app/components/TopArtists.tsx index c169448..a1db871 100644 --- a/client/app/components/TopArtists.tsx +++ b/client/app/components/TopArtists.tsx @@ -21,17 +21,19 @@ export default function TopArtists(props: Props) { queryFn: ({ queryKey }) => getTopArtists(queryKey[1] as getItemsArgs), }); + const header = "Top artists"; + if (isPending) { return (
-

Top Artists

+

{header}

Loading...

); } else if (isError) { return (
-

Top Artists

+

{header}

Error: {error.message}

); @@ -40,9 +42,7 @@ export default function TopArtists(props: Props) { return (

- - Top Artists - + {header}

diff --git a/client/app/components/TopTracks.tsx b/client/app/components/TopTracks.tsx index 85fef79..bfe31ca 100644 --- a/client/app/components/TopTracks.tsx +++ b/client/app/components/TopTracks.tsx @@ -28,17 +28,19 @@ const TopTracks = (props: Props) => { queryFn: ({ queryKey }) => getTopTracks(queryKey[1] as getItemsArgs), }); + const header = "Top tracks"; + if (isPending) { return (
-

Top Tracks

+

{header}

Loading...

); } else if (isError) { return (
-

Top Tracks

+

{header}

Error: {error.message}

); @@ -53,7 +55,7 @@ const TopTracks = (props: Props) => {

- Top Tracks + {header}

diff --git a/client/app/routes/MediaItems/Album.tsx b/client/app/routes/MediaItems/Album.tsx index b300422..afba6f7 100644 --- a/client/app/routes/MediaItems/Album.tsx +++ b/client/app/routes/MediaItems/Album.tsx @@ -50,17 +50,17 @@ export default function Album() { {album.listen_count} play{album.listen_count > 1 ? "s" : ""}

)} - { + {album.time_listened && (

{timeListenedString(album.time_listened)}

- } - { + )} + {album.first_listen && (

Listening since{" "} {new Date(album.first_listen * 1000).toLocaleDateString()}

- } + )}
} > diff --git a/client/app/routes/MediaItems/Track.tsx b/client/app/routes/MediaItems/Track.tsx index 2a45e2f..20258c1 100644 --- a/client/app/routes/MediaItems/Track.tsx +++ b/client/app/routes/MediaItems/Track.tsx @@ -49,23 +49,28 @@ export default function Track() { }} subContent={
- appears on {album.title} - {track.listen_count && ( +

+ Appears on{" "} + + {album.title} + +

+ {track.listen_count !== 0 && (

{track.listen_count} play{track.listen_count > 1 ? "s" : ""}

)} - { + {track.time_listened !== 0 && (

{timeListenedString(track.time_listened)}

- } - { + )} + {track.first_listen > 0 && (

Listening since{" "} {new Date(track.first_listen * 1000).toLocaleDateString()}

- } + )}
} >