import React from 'react'; import { RouteComponentProps } from 'react-router'; import { withRouter } from 'react-router-dom'; import { Layout, Icon, Button, Menu, } from 'antd'; import Text from 'antd/lib/typography/Text'; import getCore from '../../core'; const core = getCore(); const serverHost = core.config.backendAPI.slice(0, -7); interface HeaderContainerProps { onLogout: () => void; logoutFetching: boolean; installedAnalytics: boolean; installedAutoAnnotation: boolean; installedTFAnnotation: boolean; installedTFSegmentation: boolean; username: string; } type Props = HeaderContainerProps & RouteComponentProps; const cvatLogo = (): JSX.Element => ; const userLogo = (): JSX.Element => ; function HeaderContainer(props: Props): JSX.Element { const { installedTFSegmentation, installedAutoAnnotation, installedTFAnnotation, installedAnalytics, username, onLogout, logoutFetching, } = props; const renderModels = installedAutoAnnotation || installedTFAnnotation || installedTFSegmentation; return ( props.history.push('/tasks') } > Tasks { renderModels && ( props.history.push('/models') } > Models ) } { installedAnalytics && ( { // false positive // eslint-disable-next-line window.open(`${serverHost}/analytics/app/kibana`, '_blank'); } } > Analytics ) } { window.open('https://github.com/opencv/cvat', '_blank'); } } > GitHub { // false positive // eslint-disable-next-line window.open(`${serverHost}/documentation/user_guide.html`, '_blank') } } > Help {username.length > 14 ? `${username.slice(0, 10)} ...` : username} ) } > {logoutFetching && } Logout ); } export default withRouter(HeaderContainer);