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.
42 lines
1.2 KiB
42 lines
1.2 KiB
6 years ago
|
import { connect } from 'react-redux';
|
||
|
import { createSelector } from 'reselect';
|
||
|
import { queueLookupMovie, setImportMovieValue } from 'Store/Actions/importMovieActions';
|
||
|
import createAllMoviesSelector from 'Store/Selectors/createAllMoviesSelector';
|
||
|
import ImportMovieTable from './ImportMovieTable';
|
||
|
|
||
|
function createMapStateToProps() {
|
||
|
return createSelector(
|
||
|
(state) => state.addMovie,
|
||
|
(state) => state.importMovie,
|
||
|
(state) => state.app.dimensions,
|
||
|
createAllMoviesSelector(),
|
||
|
(addMovie, importMovie, dimensions, allMovies) => {
|
||
|
return {
|
||
|
defaultMonitor: addMovie.defaults.monitor,
|
||
|
defaultQualityProfileId: addMovie.defaults.qualityProfileId,
|
||
|
items: importMovie.items,
|
||
|
isSmallScreen: dimensions.isSmallScreen,
|
||
|
allMovies
|
||
|
};
|
||
|
}
|
||
|
);
|
||
|
}
|
||
|
|
||
|
function createMapDispatchToProps(dispatch, props) {
|
||
|
return {
|
||
|
onMovieLookup(name, path) {
|
||
|
dispatch(queueLookupMovie({
|
||
|
name,
|
||
|
path,
|
||
|
term: name
|
||
|
}));
|
||
|
},
|
||
|
|
||
|
onSetImportMovieValue(values) {
|
||
|
dispatch(setImportMovieValue(values));
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
|
||
|
export default connect(createMapStateToProps, createMapDispatchToProps)(ImportMovieTable);
|