summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/containers/app/sidebars/topology/rack/MachineContainer.js
blob: 149b4d18591510f781713eb150f6827abd029e49 (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 { goFromRackToMachine } from '../../../../../actions/interaction-level'
import MachineComponent from '../../../../../components/app/sidebars/topology/rack/MachineComponent'

const MachineContainer = (props) => {
    const machine = useSelector((state) => state.objects.machine[props.machineId])
    const dispatch = useDispatch()
    return (
        <MachineComponent {...props} onClick={() => dispatch(goFromRackToMachine(props.position))} machine={machine} />
    )
}

export default MachineContainer