summaryrefslogtreecommitdiff
path: root/opendc-web/opendc-web-ui/src/components/app/sidebars/topology/machine/MachineSidebarComponent.js
blob: d3d4a8cfa24a579a69666ab6ae6523b228e5ba09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import PropTypes from 'prop-types'
import React from 'react'
import UnitTabsComponent from './UnitTabsComponent'
import DeleteMachine from './DeleteMachine'
import {
    TextContent,
    TextList,
    TextListItem,
    TextListItemVariants,
    TextListVariants,
    Title,
} from '@patternfly/react-core'
import { useSelector } from 'react-redux'

const MachineSidebarComponent = ({ machineId }) => {
    const machine = useSelector((state) => state.objects.machine[machineId])
    return (
        <div>
            <TextContent>
                <Title headingLevel="h2">Details</Title>
                <TextList component={TextListVariants.dl}>
                    <TextListItem component={TextListItemVariants.dt}>Name</TextListItem>
                    <TextListItem component={TextListItemVariants.dd}>
                        Machine at position {machine.position}
                    </TextListItem>
                </TextList>

                <Title headingLevel="h2">Actions</Title>
                <DeleteMachine />

                <Title headingLevel="h2">Units</Title>
            </TextContent>
            <div className="pf-u-h-100">
                <UnitTabsComponent />
            </div>
        </div>
    )
}

MachineSidebarComponent.propTypes = {
    machineId: PropTypes.string,
}

export default MachineSidebarComponent