summaryrefslogtreecommitdiff
path: root/frontend/src/containers/app/sidebars/topology/machine/UnitAddContainer.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/containers/app/sidebars/topology/machine/UnitAddContainer.js')
-rw-r--r--frontend/src/containers/app/sidebars/topology/machine/UnitAddContainer.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/frontend/src/containers/app/sidebars/topology/machine/UnitAddContainer.js b/frontend/src/containers/app/sidebars/topology/machine/UnitAddContainer.js
new file mode 100644
index 00000000..0e5a6073
--- /dev/null
+++ b/frontend/src/containers/app/sidebars/topology/machine/UnitAddContainer.js
@@ -0,0 +1,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;