blob: 0e5a6073e9c33a74a5c5fa941a524459152afe51 (
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 { addUnit } from "../../../../../actions/topology/machine";
import UnitAddComponent from "../../../../../components/app/sidebars/topology/machine/UnitAddComponent";
const mapStateToProps = (state, ownProps) => {
return {
units: Object.values(state.objects[ownProps.unitType])
};
};
const mapDispatchToProps = (dispatch, ownProps) => {
return {
onAdd: id => dispatch(addUnit(ownProps.unitType, id))
};
};
const UnitAddContainer = connect(mapStateToProps, mapDispatchToProps)(
UnitAddComponent
);
export default UnitAddContainer;
|