2018-02-06 19:00:52 -08:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import View from './view';
|
|
|
|
import { fileRequested } from 'actions/show';
|
2018-02-14 18:02:10 -08:00
|
|
|
import { selectAsset } from 'selectors/show';
|
2018-02-06 19:00:52 -08:00
|
|
|
|
|
|
|
const mapStateToProps = ({ show }) => {
|
2018-02-12 20:01:02 -08:00
|
|
|
// select error and status
|
|
|
|
const error = show.displayAsset.error;
|
|
|
|
const status = show.displayAsset.status;
|
|
|
|
// select asset
|
2018-02-14 12:30:30 -08:00
|
|
|
const asset = selectAsset(show);
|
2018-02-12 20:01:02 -08:00
|
|
|
// return props
|
|
|
|
return {
|
|
|
|
error,
|
|
|
|
status,
|
|
|
|
asset,
|
2018-02-06 19:00:52 -08:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
const mapDispatchToProps = dispatch => {
|
|
|
|
return {
|
|
|
|
onFileRequest: (name, claimId) => {
|
|
|
|
dispatch(fileRequested(name, claimId));
|
|
|
|
},
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
export default connect(mapStateToProps, mapDispatchToProps)(View);
|