mirror of
https://github.com/koel/koel
synced 2024-12-24 19:43:06 +00:00
32 lines
722 B
TypeScript
32 lines
722 B
TypeScript
|
import { useRouter } from '@/composables'
|
||
|
|
||
|
export const useSongListControls = () => {
|
||
|
const { isCurrentScreen } = useRouter()
|
||
|
|
||
|
const getSongListControlsConfig = () => {
|
||
|
|
||
|
const config: SongListControlsConfig = {
|
||
|
play: true,
|
||
|
addTo: {
|
||
|
queue: true,
|
||
|
favorites: true,
|
||
|
},
|
||
|
clearQueue: true,
|
||
|
deletePlaylist: true,
|
||
|
refresh: true,
|
||
|
}
|
||
|
|
||
|
config.clearQueue = isCurrentScreen('Queue')
|
||
|
config.addTo.queue = !isCurrentScreen('Queue')
|
||
|
config.addTo.favorites = !isCurrentScreen('Favorites')
|
||
|
config.deletePlaylist = isCurrentScreen('Playlist')
|
||
|
config.refresh = isCurrentScreen('Playlist')
|
||
|
|
||
|
return config
|
||
|
}
|
||
|
|
||
|
return {
|
||
|
getSongListControlsConfig
|
||
|
}
|
||
|
}
|