Projekt

Obecné

Profil

Stáhnout (1.49 KB) Statistiky
| Větev: | Tag: | Revize:
1
import { AnnotationPanel } from '../../components/annotation/AnnotationPanel';
2
import { DocumentAnnotationView } from '../../components/annotation/DocumentAnnotationView';
3
import { TagPanel } from '../../components/annotation/TagPanel';
4
import { MainLayout } from '../../layouts/MainLayout';
5
import 'antd/dist/antd.css';
6
import styles from '/styles/Annotation.module.scss';
7
import AnnotationProvider from '../../contexts/AnnotationContext';
8
import { useRouter } from 'next/router';
9

    
10
/**
11
 * Creates an annotation screen.
12
 * @returns The annotation screen.
13
 */
14
function Annotation() {
15
    const router = useRouter();
16
    const { idRaw } = router.query;
17

    
18
    if (!idRaw || typeof idRaw === 'string') {
19
        (async () => {
20
            await router.push('/documents');
21
        })(); // TODO
22
        return;
23
    }
24

    
25
    const annotationId: string = Array.isArray(idRaw) ? idRaw[0] : idRaw;
26

    
27
    return (
28
        <AnnotationProvider annotationId={annotationId}>
29
            <MainLayout>
30
                <div className={styles.layoutWrapper}>
31
                    <div className={styles.tags}>
32
                        <TagPanel />
33
                    </div>
34
                    <div className={styles.document}>
35
                        <DocumentAnnotationView />
36
                    </div>
37
                    <div className={styles.annotations}>
38
                        <AnnotationPanel />
39
                    </div>
40
                </div>
41
            </MainLayout>
42
        </AnnotationProvider>
43
    );
44
}
45

    
46
export default Annotation;
    (1-1/1)