quintodrome/ui/src/playlist/PlaylistSongBulkActions.js

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

23 lines
598 B
JavaScript
Raw Normal View History

2020-05-16 14:10:08 -08:00
import React, { Fragment, useEffect } from 'react'
import { BulkDeleteButton, useUnselectAll } from 'react-admin'
import PropTypes from 'prop-types'
const PlaylistSongBulkActions = ({ playlistId, ...rest }) => {
const unselectAll = useUnselectAll()
useEffect(() => {
unselectAll('playlistTrack')
// eslint-disable-next-line
}, [])
return (
<Fragment>
<BulkDeleteButton {...rest} resource={`playlist/${playlistId}/tracks`} />
</Fragment>
)
}
PlaylistSongBulkActions.propTypes = {
playlistId: PropTypes.string.isRequired,
}
export default PlaylistSongBulkActions