Projekt

Obecné

Profil

Stáhnout (1.13 KB) Statistiky
| Větev: | Tag: | Revize:
1 8c45ccb0 hrubyjar
// @ts-nocheck
2 ef5792a8 Lukáš Vlček
import '../styles/globals.scss';
3 8c45ccb0 hrubyjar
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 e97fc3e6 Lukáš Vlček
import { getBasePath } from '../constants';
12 56cc66d8 Lukáš Vlček
13 8c45ccb0 hrubyjar
function MyApp({
14
    Component,
15
    pageProps,
16
}: {
17
    Component: SecuredComponent;
18
    pageProps: AppProps['pageProps'];
19
}) {
20
    return (
21
        <LoggedUserProvider>
22
            <Head>
23 e97fc3e6 Lukáš Vlček
                <link rel="shortcut icon" href={getBasePath() + '/favicon.ico'} />
24 7f244939 Lukáš Vlček
                <title>Annotation Tool (AV ČR)</title>
25 e97fc3e6 Lukáš Vlček
                <script src={getBasePath() + '/__ENV.js'} defer />
26 8c45ccb0 hrubyjar
            </Head>
27 7f244939 Lukáš Vlček
28 8c45ccb0 hrubyjar
            {Component.auth ? (
29
                <Auth minRole={Component.auth?.minRole}>
30
                    <Component {...pageProps} />
31
                </Auth>
32
            ) : (
33
                <Component {...pageProps} />
34
            )}
35
        </LoggedUserProvider>
36
    );
37 56cc66d8 Lukáš Vlček
}
38
39 8c45ccb0 hrubyjar
export default MyApp;