import { Link, useLocation, useNavigate } from 'react-router'; import ArrowBackIcon from '@mui/icons-material/ArrowBack'; import MenuIcon from '@mui/icons-material/Menu'; import { AppBar, IconButton, Toolbar, Typography } from '@mui/material'; import { useI18nContext } from 'i18n/i18n-react'; export const DRAWER_WIDTH = 210; interface LayoutAppBarProps { title: string; onToggleDrawer: () => void; } const LayoutAppBar = ({ title, onToggleDrawer }: LayoutAppBarProps) => { const { LL } = useI18nContext(); const navigate = useNavigate(); const pathnames = useLocation() .pathname.split('/') .filter((x) => x); return ( {pathnames.length > 1 && ( <> navigate('/' + pathnames[0])} > {pathnames[0] === 'status' ? LL.STATUS_OF('') : LL.SETTINGS(0)}   |   )} {title} ); }; export default LayoutAppBar;