quintodrome/ui/src/album/AlbumSongBulkActions.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

34 lines
990 B
JavaScript
Raw Normal View History

import React, { Fragment, useEffect } from 'react'
import { useUnselectAll } from 'react-admin'
2020-10-31 06:12:38 -08:00
import { playNext, playTracks } from '../audioplayer'
import { RiPlayList2Fill } from 'react-icons/ri'
2020-10-31 06:12:38 -08:00
import PlayArrowIcon from '@material-ui/icons/PlayArrow'
import { BatchPlayButton } from '../common'
2020-05-17 16:57:38 -08:00
import AddToPlaylistButton from '../song/AddToPlaylistButton'
export const AlbumSongBulkActions = (props) => {
const unselectAll = useUnselectAll()
useEffect(() => {
unselectAll('albumSong')
// eslint-disable-next-line
}, [])
return (
<Fragment>
2020-10-31 06:12:38 -08:00
<BatchPlayButton
{...props}
action={playTracks}
label={'resources.song.actions.playNow'}
icon={<PlayArrowIcon />}
/>
<BatchPlayButton
2020-09-21 16:10:52 -08:00
{...props}
action={playNext}
label={'resources.song.actions.playNext'}
icon={<RiPlayList2Fill />}
2020-09-21 16:10:52 -08:00
/>
2020-10-31 06:12:38 -08:00
<BatchPlayButton {...props} />
2020-05-17 16:57:38 -08:00
<AddToPlaylistButton {...props} />
</Fragment>
)
}