diff --git a/src/components/SpotifyNowPlaying.tsx b/src/components/SpotifyNowPlaying.tsx index e3ec411..7d543e9 100644 --- a/src/components/SpotifyNowPlaying.tsx +++ b/src/components/SpotifyNowPlaying.tsx @@ -30,7 +30,7 @@ const StyledTypography = styled(Typography)(({ theme }) => ({ }, })); -function SpotifyMessage({ message }: { message: string }) { +function SpotifyStatusMessage({ message }: { message: string }) { return ( @@ -60,45 +60,52 @@ export default function SpotifyNowPlaying() { return ( <> {loading ? ( - - ) : nowPlayingData && nowPlayingData?.is_playing ? ( - - - {nowPlayingData.item.name} - - {nowPlayingData.item?.artists - .map((_artist) => _artist.name) - .join(",")} - - + + ) : nowPlayingData && + nowPlayingData?.is_playing && + nowPlayingData?.currently_playing_type === "track" ? ( + <> + + MOOD: + + + + {nowPlayingData.item.name} + + {nowPlayingData.item?.artists + .map((_artist) => _artist.name) + .join(",")} + + - - - Spotify - + + + Spotify + - - - - - + + + + + + ) : ( - + )} ); diff --git a/src/services/spotify.ts b/src/services/spotify.ts index dfc7456..430e8bd 100644 --- a/src/services/spotify.ts +++ b/src/services/spotify.ts @@ -44,6 +44,7 @@ const getAccessToken = async ({ export type GetNowPlayingResponse = { is_playing: boolean; + currently_playing_type: string; item: NowPlayingItem; };