summaryrefslogtreecommitdiff
path: root/frontend/src/containers/app/sidebars/topology/room/RackConstructionContainer.js
blob: cd8319debe3fc16c98cd6424e7d2db2719a5d3d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import { connect } from 'react-redux'
import { startRackConstruction, stopRackConstruction } from '../../../../../actions/topology/room'
import RackConstructionComponent from '../../../../../components/app/sidebars/topology/room/RackConstructionComponent'

const mapStateToProps = (state) => {
    return {
        inRackConstructionMode: state.construction.inRackConstructionMode,
        isEditingRoom: state.construction.currentRoomInConstruction !== '-1',
    }
}

const mapDispatchToProps = (dispatch) => {
    return {
        onStart: () => dispatch(startRackConstruction()),
        onStop: () => dispatch(stopRackConstruction()),
    }
}

const RackConstructionContainer = connect(mapStateToProps, mapDispatchToProps)(RackConstructionComponent)

export default RackConstructionContainer