import PropTypes from 'prop-types' import React from 'react' import { InteractionLevel } from '../../../../shapes' import BuildingSidebarComponent from './building/BuildingSidebarComponent' 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 { goDownOneInteractionLevel } from '../../../../redux/actions/interaction-level' import { backButton } from './TopologySidebar.module.scss' import RoomSidebarContainer from './room/RoomSidebarContainer' import RackSidebarContainer from './rack/RackSidebarContainer' import MachineSidebarContainer from './machine/MachineSidebarContainer' const name = { BUILDING: 'Building', ROOM: 'Room', RACK: 'Rack', MACHINE: 'Machine', } const 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