import React, { Component } from 'react'; import { Redirect, Switch, RouteComponentProps } from 'react-router-dom' import { Tabs, Tab } from '@material-ui/core'; import { WithFeaturesProps, withFeatures } from '../features/FeaturesContext'; import { withAuthenticatedContext, AuthenticatedContextProps, AuthenticatedRoute } from '../authentication'; import { MenuAppBar } from '../components'; import SystemStatusController from './SystemStatusController'; import OTASettingsController from './OTASettingsController'; import UploadFirmwareController from './UploadFirmwareController'; type SystemProps = AuthenticatedContextProps & RouteComponentProps & WithFeaturesProps; class System extends Component { handleTabChange = (event: React.ChangeEvent<{}>, path: string) => { this.props.history.push(path); }; render() { const { authenticatedContext, features } = this.props; return ( {features.ota && ( )} {features.upload_firmware && ( )} {features.ota && ( )} {features.upload_firmware && ( )} ) } } export default withFeatures(withAuthenticatedContext(System));