diff --git a/src/components/music/MusicPlayer.jsx b/src/components/music/MusicPlayer.jsx index c6bd1ba..a61a1f8 100644 --- a/src/components/music/MusicPlayer.jsx +++ b/src/components/music/MusicPlayer.jsx @@ -1,5 +1,14 @@ import React, { useRef, useEffect } from "react"; -import { Play, Pause, SkipBack, SkipForward, Volume1, Volume2, VolumeX, Shuffle } from "lucide-react"; +import { + Play, + Pause, + SkipBack, + SkipForward, + Volume1, + Volume2, + VolumeX, + Shuffle, +} from "lucide-react"; import ReactPlayer from "react-player"; import Api from "../../Api"; import { getImageColors } from "../color/ColorGenrator"; @@ -13,7 +22,7 @@ function MusicPlayer() { const [bgColor, setBgColor] = React.useState(); const [musicPlayerDrawer, setMusicPlayerDrawer] = React.useState(false); const [song, setSong] = React.useState(); - + // Get state from Zustand stores const { songs } = useFetch(); const { @@ -32,7 +41,7 @@ function MusicPlayer() { setDuration, setShuffle, playNext, - playPrevious + playPrevious, } = useStore(); // Keyboard shortcuts @@ -122,85 +131,101 @@ function MusicPlayer() { const VolumeIcon = muted || volume === 0 ? VolumeX : volume > 0.5 ? Volume2 : Volume1; return ( - song && - ( <> - - - - - -