import Toolbar from '@mui/material/Toolbar'; import Typography from '@mui/material/Typography'; import type { ToolbarProps } from '@mui/material/Toolbar/Toolbar'; import type { FC } from 'react'; export type ErrorPageToolbarProps = ToolbarProps & { type?: '404' | 'ErrorBoundary'; }; const TITLE: Record, string> = { 404: 'Страницы не существует', ErrorBoundary: 'Непредвиденная ошибка', }; const ErrorPageToolbar: FC = (props) => { const { type = 'ErrorBoundary', ...restProps } = props; return ( {TITLE[type]} ); }; export default ErrorPageToolbar;