MCPcopy Index your code
hub / github.com/WebDevSimplified/spotify-clone / Player

Function Player

client/src/Player.js:4–21  ·  view source on GitHub ↗
({ accessToken, trackUri })

Source from the content-addressed store, hash-verified

2import SpotifyPlayer from "react-spotify-web-playback"
3
4export default function Player({ accessToken, trackUri }) {
5 const [play, setPlay] = useState(false)
6
7 useEffect(() => setPlay(true), [trackUri])
8
9 if (!accessToken) return null
10 return (
11 <SpotifyPlayer
12 token={accessToken}
13 showSaveIcon
14 callback={state => {
15 if (!state.isPlaying) setPlay(false)
16 }}
17 play={play}
18 uris={trackUri ? [trackUri] : []}
19 />
20 )
21}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected