blob: 7ff06f4f73c928e1e33d99040210d3ab02d9cb87 (
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
|