summaryrefslogtreecommitdiff
path: root/src/containers/app/sidebars/topology/rack/EmptySlotContainer.js
blob: b8f5e5531b51cac575c2cc6d7fb6fef470340ec4 (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/app/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;