mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-31 03:02:00 +08:00

* add no-array-index-key rule * fix array indexing errors * convert string concat to template strings * make component key simpler * remove unused var
28 lines
808 B
TypeScript
28 lines
808 B
TypeScript
import NotFound from 'components/NotFound';
|
|
import Spinner from 'components/Spinner';
|
|
import ROUTES from 'constants/routes';
|
|
import AppLayout from 'container/AppLayout';
|
|
import history from 'lib/history';
|
|
import React, { Suspense } from 'react';
|
|
import { Redirect, Route, Router, Switch } from 'react-router-dom';
|
|
|
|
import routes from './routes';
|
|
|
|
const App = (): JSX.Element => (
|
|
<Router history={history}>
|
|
<AppLayout>
|
|
<Suspense fallback={<Spinner size="large" tip="Loading..." />}>
|
|
<Switch>
|
|
{routes.map(({ path, component, exact }) => (
|
|
<Route key={`${path}`} exact={exact} path={path} component={component} />
|
|
))}
|
|
<Redirect from="/" to={ROUTES.APPLICATION} />
|
|
<Route component={NotFound} />
|
|
</Switch>
|
|
</Suspense>
|
|
</AppLayout>
|
|
</Router>
|
|
);
|
|
|
|
export default App;
|