mirror of
https://github.com/skidoodle/albert.lol.git
synced 2025-02-15 06:09:15 +01:00
commit
This commit is contained in:
commit
b9dc57578a
26 changed files with 2590 additions and 0 deletions
31
components/Spotify.tsx
Normal file
31
components/Spotify.tsx
Normal file
|
@ -0,0 +1,31 @@
|
|||
import { useLastFM } from 'use-last-fm'
|
||||
import { FaSpotify } from 'react-icons/fa'
|
||||
import styles from 'styles/Home.module.scss'
|
||||
|
||||
const Spotify = () => {
|
||||
const lastFM = useLastFM('albrtadam', 'f6d19bc25ca340225c70c3d386cd4eab');
|
||||
|
||||
return(
|
||||
<div className={styles.spotify}>
|
||||
{lastFM.status === 'playing'
|
||||
?
|
||||
<>
|
||||
<a href={lastFM.song.url} target='_blank' rel='noopener noreferrer'>
|
||||
<img src={lastFM.song.art} width={50} height={50} alt=""/>
|
||||
<p>Listening to <b>{lastFM.song.name}</b></p>
|
||||
</a>
|
||||
</>
|
||||
:
|
||||
<>
|
||||
<img src='song_art.png' width={50} height={50} alt=""/>
|
||||
<p>Not listening to anything</p>
|
||||
</>
|
||||
}
|
||||
<div className={styles.tinyText}>
|
||||
<FaSpotify /> Spotify
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default Spotify
|
Loading…
Add table
Add a link
Reference in a new issue