import PropTypes from 'prop-types' import React from 'react' import { InteractionLevel } from '../../../shapes' import BuildingSidebar from './building/BuildingSidebar' import { Button, DrawerActions, DrawerCloseButton, DrawerHead, DrawerPanelBody, DrawerPanelContent, Flex, Title, } from '@patternfly/react-core' import { AngleLeftIcon } from '@patternfly/react-icons' import { useDispatch } from 'react-redux' import { backButton } from './TopologySidebar.module.css' import RoomSidebar from './room/RoomSidebar' import RackSidebar from './rack/RackSidebar' import MachineSidebar from './machine/MachineSidebar' import { goDownOneInteractionLevel } from '../../../redux/actions/interaction-level' const name = { BUILDING: 'Building', ROOM: 'Room', RACK: 'Rack', MACHINE: 'Machine', } function TopologySidebar({ interactionLevel, onClose }) { let sidebarContent switch (interactionLevel.mode) { case 'BUILDING': sidebarContent = break case 'ROOM': sidebarContent = break case 'RACK': sidebarContent = break case 'MACHINE': sidebarContent = break default: sidebarContent = 'Missing Content' } const dispatch = useDispatch() const onClick = () => dispatch(goDownOneInteractionLevel()) return ( {name[interactionLevel.mode]} {sidebarContent} ) } TopologySidebar.propTypes = { interactionLevel: InteractionLevel, onClose: PropTypes.func, } export default TopologySidebar