From cef20f59c50fd962bfabcd3248a7c390bfb615ee Mon Sep 17 00:00:00 2001 From: mbrucedogs Date: Mon, 21 Jul 2025 08:25:04 -0500 Subject: [PATCH] Signed-off-by: mbrucedogs --- src/components/common/PlayerControls.tsx | 173 ++++++++++++----------- 1 file changed, 87 insertions(+), 86 deletions(-) diff --git a/src/components/common/PlayerControls.tsx b/src/components/common/PlayerControls.tsx index 7c46215..c56a285 100644 --- a/src/components/common/PlayerControls.tsx +++ b/src/components/common/PlayerControls.tsx @@ -87,6 +87,9 @@ const PlayerControls: React.FC = ({ className = '', variant }; const getStatusText = () => { + if (!hasSongsInQueue) { + return 'No songs in queue'; + } switch (currentState) { case PlayerState.playing: return 'Currently Playing'; @@ -113,62 +116,60 @@ const PlayerControls: React.FC = ({ className = '', variant {getStatusText()} - {/* Control Buttons */} - {currentState === PlayerState.playing ? ( -
- - Pause -
- ) : ( -
- - Play -
+ {hasSongsInQueue && ( + <> + {currentState === PlayerState.playing ? ( +
+ + Pause +
+ ) : ( +
+ + Play +
+ )} + {currentState !== PlayerState.stopped && ( +
+ + Stop +
+ )} + )} - - {currentState !== PlayerState.stopped && ( -
- - Stop -
- )} - {!hasSongsInQueue && ( -
+
Add songs to queue to enable playback controls
)} @@ -187,42 +188,42 @@ const PlayerControls: React.FC = ({ className = '', variant
- -
- {currentState === PlayerState.playing ? ( - - ) : ( - - )} - - {currentState !== PlayerState.stopped && ( - - )} -
- + {/* Only show controls if there are songs in the queue */} + {hasSongsInQueue && ( +
+ {currentState === PlayerState.playing ? ( + + ) : ( + + )} + {currentState !== PlayerState.stopped && ( + + )} +
+ )}
Admin controls - Only visible to admin users {!hasSongsInQueue && ( -
+
Add songs to queue to enable playback controls
)}