Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/components/Player.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ export function Player () {
setIsPlaying(!isPlaying)
}

const isSongLoaded = !!currentMusic.song;

return (
<div className="flex flex-row justify-between w-full px-1 z-50">
<div className="w-[200px]">
Expand All @@ -166,7 +168,7 @@ export function Player () {

<div className="grid place-content-center gap-4 flex-1">
<div className="flex justify-center flex-col items-center">
<button className="bg-white rounded-full p-2" onClick={handleClick}>
<button className="bg-white rounded-full p-2" onClick={handleClick} disabled={!isSongLoaded}>
{isPlaying ? <Pause /> : <Play />}
</button>
<SongControl audio={audioRef} />
Expand All @@ -180,4 +182,4 @@ export function Player () {
</div>
</div>
)
}
}