diff --git a/src/components/SpotifyCard.tsx b/src/components/SpotifyCard.tsx index 740651e..e4bbd77 100644 --- a/src/components/SpotifyCard.tsx +++ b/src/components/SpotifyCard.tsx @@ -11,6 +11,8 @@ interface SpotifyData { title: string url: string image: string + progress: number + length: number } } @@ -29,33 +31,55 @@ export const NowPlayingCard = () => { } }, []) + const calcProgress = () => { + if (spotify.song && spotify.song.length > 0) { + const progressPercentage = + (spotify.song.progress / spotify.song.length) * 100 + return `${progressPercentage}%` + } + return '0%' + } + return (