summaryrefslogtreecommitdiff
path: root/src/containers/sidebars/topology/rack/EmptySlotContainer.js
blob: aa0673d1dff855908aace5769d8c1509ee755a25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import {connect} from "react-redux";
import {addMachine} from "../../../../actions/topology/rack";
import EmptySlotComponent from "../../../../components/sidebars/topology/rack/EmptySlotComponent";

const mapStateToProps = state => {
    return {
        inSimulation: state.currentExperimentId !== -1
    };
};

const mapDispatchToProps = (dispatch, ownProps) => {
    return {
        onAdd: () => dispatch(addMachine(ownProps.position)),
    };
};

const EmptySlotContainer = connect(
    mapStateToProps,
    mapDispatchToProps
)(EmptySlotComponent);

export default EmptySlotContainer;