blob: 3d24859efd8358342c56df4ab376a9dbfdacbbf2 (
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 '../../../../../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
|