mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-10-18 19:51:30 +08:00
39 lines
903 B
TypeScript
39 lines
903 B
TypeScript
import NotFound from 'components/NotFound';
|
|
import Spinner from 'components/Spinner';
|
|
import AppLayout from 'container/AppLayout';
|
|
import history from 'lib/history';
|
|
import React, { Suspense } from 'react';
|
|
import { Route, Router, Switch } from 'react-router-dom';
|
|
|
|
import PrivateRoute from './Private';
|
|
import routes from './routes';
|
|
|
|
function App(): JSX.Element {
|
|
return (
|
|
<Router history={history}>
|
|
<PrivateRoute>
|
|
<AppLayout>
|
|
<Suspense fallback={<Spinner size="large" tip="Loading..." />}>
|
|
<Switch>
|
|
{routes.map(({ path, component, exact }) => {
|
|
return (
|
|
<Route
|
|
key={`${path}`}
|
|
exact={exact}
|
|
path={path}
|
|
component={component}
|
|
/>
|
|
);
|
|
})}
|
|
|
|
<Route path="*" component={NotFound} />
|
|
</Switch>
|
|
</Suspense>
|
|
</AppLayout>
|
|
</PrivateRoute>
|
|
</Router>
|
|
);
|
|
}
|
|
|
|
export default App;
|