quintodrome/ui/src/common/SongBulkActions.js

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

41 lines
1.1 KiB
JavaScript
Raw Normal View History

import React, { Fragment, useEffect } from 'react'
import { useUnselectAll } from 'react-admin'
import { addTracks, playNext, playTracks } from '../audioplayer'
import { RiPlayList2Fill, RiPlayListAddFill } from 'react-icons/ri'
2020-10-31 06:12:38 -08:00
import PlayArrowIcon from '@material-ui/icons/PlayArrow'
import { BatchPlayButton } from './index'
import AddToPlaylistButton from './AddToPlaylistButton'
const SongBulkActions = (props) => {
const unselectAll = useUnselectAll()
useEffect(() => {
unselectAll(props.resource)
// 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
/>
<BatchPlayButton
{...props}
action={addTracks}
label={'resources.song.actions.addToQueue'}
icon={<RiPlayListAddFill />}
/>
2020-05-17 16:57:38 -08:00
<AddToPlaylistButton {...props} />
</Fragment>
)
}
export default SongBulkActions