mirror of
https://github.com/koel/koel
synced 2024-12-24 03:23:06 +00:00
31 lines
722 B
TypeScript
31 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
|
|
}
|
|
}
|