blob: 614421b4f3039cb4d99a678ea076b9c0a4ae12a2 (
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
|