You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Readarr/frontend/src/Artist/Delete/DeleteArtistModalContentCon...

57 lines
1.3 KiB

import PropTypes from 'prop-types';
import React, { Component } from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import createArtistSelector from 'Store/Selectors/createArtistSelector';
import { deleteArtist } from 'Store/Actions/artistActions';
import DeleteArtistModalContent from './DeleteArtistModalContent';
function createMapStateToProps() {
return createSelector(
createArtistSelector(),
(artist) => {
return artist;
}
);
}
const mapDispatchToProps = {
deleteArtist
};
class DeleteArtistModalContentConnector extends Component {
//
// Listeners
onDeletePress = (deleteFiles, addImportListExclusion) => {
this.props.deleteArtist({
id: this.props.authorId,
deleteFiles,
addImportListExclusion
});
this.props.onModalClose(true);
}
//
// Render
render() {
return (
<DeleteArtistModalContent
{...this.props}
onDeletePress={this.onDeletePress}
/>
);
}
}
DeleteArtistModalContentConnector.propTypes = {
authorId: PropTypes.number.isRequired,
onModalClose: PropTypes.func.isRequired,
deleteArtist: PropTypes.func.isRequired
};
export default connect(createMapStateToProps, mapDispatchToProps)(DeleteArtistModalContentConnector);