Projekt

Obecné

Profil

Stáhnout (1.69 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 TagCategoryProvider from '../../contexts/TagCategoryContext';
9

    
10
import { useRouter } from 'next/router';
11

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

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

    
25
        return <p>Načítání...</p>;
26
    }
27

    
28
    const annotationId: string = Array.isArray(id) ? id[0] : id;
29

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

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