1 |
8c45ccb0
|
hrubyjar
|
// @ts-nocheck
|
2 |
|
|
import '../styles/globals.css';
|
3 |
|
|
import 'bootstrap/dist/css/bootstrap.css';
|
4 |
06d1aa21
|
Jaroslav Hrubý
|
import '@fortawesome/fontawesome-svg-core/styles.css';
|
5 |
56cc66d8
|
Lukáš Vlček
|
|
6 |
8c45ccb0
|
hrubyjar
|
import type { AppProps } from 'next/app';
|
7 |
|
|
import Head from 'next/head';
|
8 |
7a32656e
|
Jaroslav Hrubý
|
import { SecuredComponent } from '../components/types/Auth';
|
9 |
8c45ccb0
|
hrubyjar
|
import LoggedUserProvider from '../contexts/LoggedUserContext';
|
10 |
|
|
import Auth from '../components/common/Auth';
|
11 |
56cc66d8
|
Lukáš Vlček
|
|
12 |
8c45ccb0
|
hrubyjar
|
function MyApp({
|
13 |
|
|
Component,
|
14 |
|
|
pageProps,
|
15 |
|
|
}: {
|
16 |
|
|
Component: SecuredComponent;
|
17 |
|
|
pageProps: AppProps['pageProps'];
|
18 |
|
|
}) {
|
19 |
|
|
return (
|
20 |
|
|
<LoggedUserProvider>
|
21 |
|
|
<Head>
|
22 |
|
|
<link rel="shortcut icon" href={'/favicon.ico'} />
|
23 |
7f244939
|
Lukáš Vlček
|
<title>Annotation Tool (AV ČR)</title>
|
24 |
|
|
<script src="/__ENV.js" defer />
|
25 |
8c45ccb0
|
hrubyjar
|
</Head>
|
26 |
7f244939
|
Lukáš Vlček
|
|
27 |
8c45ccb0
|
hrubyjar
|
{Component.auth ? (
|
28 |
|
|
<Auth minRole={Component.auth?.minRole}>
|
29 |
|
|
<Component {...pageProps} />
|
30 |
|
|
</Auth>
|
31 |
|
|
) : (
|
32 |
|
|
<Component {...pageProps} />
|
33 |
|
|
)}
|
34 |
|
|
</LoggedUserProvider>
|
35 |
|
|
);
|
36 |
56cc66d8
|
Lukáš Vlček
|
}
|
37 |
|
|
|
38 |
8c45ccb0
|
hrubyjar
|
export default MyApp;
|