feat: display remaining time instead of total duration in AudioPlayer

This commit is contained in:
codytseng
2025-07-30 22:23:43 +08:00
parent e69395dca0
commit ed4800de6e

View File

@@ -98,7 +98,9 @@ export default function AudioPlayer({ src, className }: AudioPlayerProps) {
<Slider value={[currentTime]} max={duration || 100} step={1} onValueChange={handleSeek} />
</div>
<div className="text-sm font-mono text-muted-foreground">{formatTime(duration)}</div>
<div className="text-sm font-mono text-muted-foreground">
{formatTime(Math.max(duration - currentTime, 0))}
</div>
</div>
)
}