import React from 'react'; import { RouteComponentProps } from 'react-router'; import { withRouter } from 'react-router-dom'; import { Layout, Radio, Icon, Button, Menu, Modal, } from 'antd'; import Text from 'antd/lib/typography/Text'; interface HeaderContainerProps { onLogout: () => void; username: string; logoutError: string; } function HeaderContainer(props: HeaderContainerProps & RouteComponentProps) { const cvatLogo = () => (); const backLogo = () => (); const userLogo = () => (); if (props.logoutError) { Modal.error({ title: 'Could not logout', content: `${props.logoutError}`, }); } let activeTab = null; if (props.history.location.pathname === '/tasks') { activeTab = 'tasks'; } else if (props.history.location.pathname === '/models') { activeTab = 'models'; } return (
props.history.push('/tasks') }> Tasks props.history.push('/models') }> Models
{props.username} }> Logout
); } export default withRouter(HeaderContainer);