blob: 365bb06249c8be85deafc8a07723578f399ae284 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
import { connect } from "react-redux";
import RackGroup from "../../../components/app/map/groups/RackGroup";
import { getStateLoad } from "../../../util/simulation-load";
const mapStateToProps = (state, ownProps) => {
const inSimulation = state.currentExperimentId !== -1;
let rackLoad = undefined;
if (inSimulation) {
if (
state.states.rack[state.currentTick] &&
state.states.rack[state.currentTick][ownProps.tile.objectId]
) {
rackLoad = getStateLoad(
state.loadMetric,
state.states.rack[state.currentTick][ownProps.tile.objectId]
);
}
}
return {
interactionLevel: state.interactionLevel,
inSimulation,
rackLoad
};
};
const RackContainer = connect(mapStateToProps)(RackGroup);
export default RackContainer;
|