feat: add 'single' play mode option and corresponding icon in MusicPlayer
This commit is contained in:
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user