2018-02-07 19:52:09 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import View from './view';
|
2018-01-30 18:00:02 +01:00
|
|
|
|
2018-02-07 19:52:09 +01:00
|
|
|
const mapStateToProps = ({ show }) => {
|
2018-02-13 03:18:56 +01:00
|
|
|
// select name and claim id
|
2018-02-13 05:01:02 +01:00
|
|
|
let name, claimId;
|
2018-02-13 04:01:29 +01:00
|
|
|
const previousRequest = show.assetRequests[show.request.id];
|
|
|
|
const assetKey = `a#${previousRequest.name}#${previousRequest.claimId}`;
|
2018-02-13 03:50:19 +01:00
|
|
|
const asset = show.assetList[assetKey];
|
|
|
|
if (asset) {
|
2018-02-13 05:01:02 +01:00
|
|
|
name = asset.name;
|
|
|
|
claimId = asset.claimId;
|
|
|
|
};
|
|
|
|
// return props
|
|
|
|
return {
|
|
|
|
name,
|
|
|
|
claimId,
|
2018-02-07 19:52:09 +01:00
|
|
|
};
|
2018-01-30 18:00:02 +01:00
|
|
|
};
|
|
|
|
|
2018-02-07 19:52:09 +01:00
|
|
|
export default connect(mapStateToProps, null)(View);
|