Projekt

Obecné

Profil

Stáhnout (1.5 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 { id } = router.query;
17

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

    
23
        return <p>Načítání...</p>;
24
    }
25

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

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

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