blob: acb16a2111051513fec4a5742467b4100ead8a8e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
import React from 'react'
import { useDispatch, useSelector } from 'react-redux'
import { deleteUnit } from '../../../../../redux/actions/topology/machine'
import UnitComponent from '../../../../../components/app/sidebars/topology/machine/UnitComponent'
const UnitContainer = ({ unitId, unitType }) => {
const dispatch = useDispatch()
const unit = useSelector((state) => state.objects[unitType][unitId])
const onDelete = () => dispatch(deleteUnit(unitType, unitId))
return <UnitComponent index={unitId} unit={unit} unitType={unitType} onDelete={onDelete} />
}
export default UnitContainer
|