summaryrefslogtreecommitdiff
path: root/frontend/src/containers/app/sidebars/topology/machine/UnitContainer.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/containers/app/sidebars/topology/machine/UnitContainer.js')
-rw-r--r--frontend/src/containers/app/sidebars/topology/machine/UnitContainer.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/frontend/src/containers/app/sidebars/topology/machine/UnitContainer.js b/frontend/src/containers/app/sidebars/topology/machine/UnitContainer.js
new file mode 100644
index 00000000..a919e8d3
--- /dev/null
+++ b/frontend/src/containers/app/sidebars/topology/machine/UnitContainer.js
@@ -0,0 +1,22 @@
+import { connect } from "react-redux";
+import { deleteUnit } from "../../../../../actions/topology/machine";
+import UnitComponent from "../../../../../components/app/sidebars/topology/machine/UnitComponent";
+
+const mapStateToProps = (state, ownProps) => {
+ return {
+ unit: state.objects[ownProps.unitType][ownProps.unitId],
+ inSimulation: state.currentExperimentId !== -1
+ };
+};
+
+const mapDispatchToProps = (dispatch, ownProps) => {
+ return {
+ onDelete: () => dispatch(deleteUnit(ownProps.unitType, ownProps.index))
+ };
+};
+
+const UnitContainer = connect(mapStateToProps, mapDispatchToProps)(
+ UnitComponent
+);
+
+export default UnitContainer;