feat: add 'single' play mode option and corresponding icon in MusicPlayer

This commit is contained in:
JSC
2025-07-12 20:49:29 +02:00
parent f7dc3a4040
commit 4101047f55
2 changed files with 6 additions and 3 deletions

View File

@@ -17,7 +17,8 @@ import {
List,
Maximize2,
Minimize2,
Minus
Minus,
ArrowRightToLine
} from 'lucide-react'
import { formatDuration } from '@/lib/format-duration'
@@ -79,13 +80,15 @@ export function MusicPlayer() {
return <Repeat1 className="h-4 w-4" />
case 'random':
return <Shuffle className="h-4 w-4" />
case 'single':
return <ArrowRightToLine className="h-4 w-4" />
default:
return <Play className="h-4 w-4" />
}
}
const handlePlayModeToggle = () => {
const modes = ['continuous', 'loop-playlist', 'loop-one', 'random'] as const
const modes = ['continuous', 'loop-playlist', 'loop-one', 'random', 'single'] as const
const currentIndex = modes.indexOf(playMode)
const nextIndex = (currentIndex + 1) % modes.length
setPlayMode(modes[nextIndex])