Projekt

Obecné

Profil

Stáhnout (1.13 KB) Statistiky
| Větev: | Tag: | Revize:
1
// @ts-nocheck
2
import '../styles/globals.scss';
3
import 'bootstrap/dist/css/bootstrap.css';
4
import '@fortawesome/fontawesome-svg-core/styles.css';
5

    
6
import type { AppProps } from 'next/app';
7
import Head from 'next/head';
8
import { SecuredComponent } from '../components/types/Auth';
9
import LoggedUserProvider from '../contexts/LoggedUserContext';
10
import Auth from '../components/common/Auth';
11
import { getBasePath } from '../constants';
12

    
13
function MyApp({
14
    Component,
15
    pageProps,
16
}: {
17
    Component: SecuredComponent;
18
    pageProps: AppProps['pageProps'];
19
}) {
20
    return (
21
        <LoggedUserProvider>
22
            <Head>
23
                <link rel="shortcut icon" href={getBasePath() + '/favicon.ico'} />
24
                <title>Annotation Tool (AV ČR)</title>
25
                <script src={getBasePath() + '/__ENV.js'} defer />
26
            </Head>
27

    
28
            {Component.auth ? (
29
                <Auth minRole={Component.auth?.minRole}>
30
                    <Component {...pageProps} />
31
                </Auth>
32
            ) : (
33
                <Component {...pageProps} />
34
            )}
35
        </LoggedUserProvider>
36
    );
37
}
38

    
39
export default MyApp;
(1-1/3)