Files
Readarr/frontend/src/Author/Delete/DeleteAuthorModalContentConnector.js
Qstick 1caa49c895 Update UI Packages
Align with Lidarr
2023-01-24 11:51:34 -06:00

57 lines
1.3 KiB
JavaScript

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