import React, { Component } from 'react'; import { Link } from 'react-router-dom'; import PropTypes from 'prop-types'; import classnames from 'classnames'; import { Trans, withNamespaces } from 'react-i18next'; import Menu from './Menu'; import Version from './Version'; import logo from './logo.svg'; import './Header.css'; class Header extends Component { state = { isMenuOpen: false, isDropdownOpen: false, }; toggleMenuOpen = () => { this.setState(prevState => ({ isMenuOpen: !prevState.isMenuOpen })); }; closeMenu = () => { this.setState({ isMenuOpen: false }); }; render() { const { dashboard } = this.props; const badgeClass = classnames({ 'badge dns-status': true, 'badge-success': dashboard.protectionEnabled, 'badge-danger': !dashboard.protectionEnabled, }); return (
{!dashboard.proccessing && dashboard.isCoreRunning && {dashboard.protectionEnabled ? 'ON' : 'OFF'} }
); } } Header.propTypes = { dashboard: PropTypes.object, location: PropTypes.object, }; export default withNamespaces()(Header);