diff --git a/src/components/PlayerBar.tsx b/src/components/PlayerBar.tsx index b761b74..f12b9f0 100644 --- a/src/components/PlayerBar.tsx +++ b/src/components/PlayerBar.tsx @@ -267,6 +267,7 @@ const ProgressScrubber = memo(function ProgressScrubber() { setIsHoveringProgress, handleProgressMouseDown, } = useProgressScrub(); + const [showTimeLeft, setShowTimeLeft] = useState(false); return (
@@ -308,8 +309,15 @@ const ProgressScrubber = memo(function ProgressScrubber() { }} />
- - {currentTrack ? formatTime(duration) : "0:00"} + currentTrack && setShowTimeLeft((v) => !v)} + > + {currentTrack + ? showTimeLeft + ? `-${formatTime(Math.max(0, duration - displayTime))}` + : formatTime(duration) + : "0:00"} );