blob: 29e480165db5d69dca1a79587f9dc796c1eec1a7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
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
|