Projekt

Obecné

Profil

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