({ accessToken, trackUri })
| 2 | import SpotifyPlayer from "react-spotify-web-playback" |
| 3 | |
| 4 | export 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 | } |
nothing calls this directly
no outgoing calls
no test coverage detected