import React, { Component } from "react"; import { Menu, Grid, Icon, Responsive, Dropdown } from "semantic-ui-react"; import { editButtonStyle } from "../components/dashboard/devices/styleComponents"; import ModalWindow from "../components/modalform"; class Navbar extends Component { constructor(props) { super(props); this.state = { activeItemName: "Home", activeItem: -1, edited: "", editMode: false, room: "", }; } componentDidMount() { this.setState({ activeItem: this.props.activeItem, }); } editModeController = (e) => this.setState((prevState) => ({ editMode: !prevState.editMode })); handleClick = (e, { id, name }) => { const room = this.props.rooms.filter((d) => d.id === id)[0]; console.log(room); this.setState({ activeItem: id, activeItemName: name, }); this.activeRoom = room; console.log(this.activeRoom); this.forceUpdate(); this.props.handleItemClick(id); }; render() { return (