add timeframe selectors for rewind

This commit is contained in:
Gabe Farrell 2026-01-12 20:28:22 -05:00
parent ddb0becc0f
commit a0b32f756e
2 changed files with 184 additions and 30 deletions

View file

@ -8,9 +8,16 @@ interface Props {
}
export default function Rewind(props: Props) {
const artistimg = props.stats.top_artists[0].image;
const albumimg = props.stats.top_albums[0].image;
const trackimg = props.stats.top_tracks[0].image;
const artistimg = props.stats.top_artists[0]?.image;
const albumimg = props.stats.top_albums[0]?.image;
const trackimg = props.stats.top_tracks[0]?.image;
if (
!props.stats.top_artists[0] ||
!props.stats.top_albums[0] ||
!props.stats.top_tracks[0]
) {
return <p>Not enough data exists to create a Rewind for this period :(</p>;
}
return (
<div className="flex flex-col gap-7">
<h2>{props.stats.title}</h2>