Projekt

Obecné

Profil

Stáhnout (1.69 KB) Statistiky
| Větev: | Tag: | Revize:
1 c73aecde Dominik Poch
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 6d10fe14 Dominik Poch
import 'antd/dist/antd.css';
6 c73aecde Dominik Poch
import styles from '/styles/Annotation.module.scss';
7 acb8a961 Dominik Poch
import AnnotationProvider from '../../contexts/AnnotationContext';
8 4bc99591 Lukáš Vlček
import TagCategoryProvider from '../../contexts/TagCategoryContext';
9
10 7595035c Lukáš Vlček
import { useRouter } from 'next/router';
11 6d10fe14 Dominik Poch
12
/**
13
 * Creates an annotation screen.
14
 * @returns The annotation screen.
15
 */
16
function Annotation() {
17 7595035c Lukáš Vlček
    const router = useRouter();
18 7652cf88 Lukáš Vlček
    const { id } = router.query;
19 7595035c Lukáš Vlček
20 7652cf88 Lukáš Vlček
    if (!id || typeof id !== 'string') {
21
        /*(async () => {
22 7595035c Lukáš Vlček
            await router.push('/documents');
23 7652cf88 Lukáš Vlček
        })(); // TODO*/
24
25
        return <p>Načítání...</p>;
26 7595035c Lukáš Vlček
    }
27
28 7652cf88 Lukáš Vlček
    const annotationId: string = Array.isArray(id) ? id[0] : id;
29 7595035c Lukáš Vlček
30 6d10fe14 Dominik Poch
    return (
31 7595035c Lukáš Vlček
        <AnnotationProvider annotationId={annotationId}>
32 4bc99591 Lukáš Vlček
            <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 c057279b Lukáš Vlček
                    </div>
45 4bc99591 Lukáš Vlček
                </MainLayout>
46
            </TagCategoryProvider>
47 c057279b Lukáš Vlček
        </AnnotationProvider>
48 6d10fe14 Dominik Poch
    );
49
}
50
51
export default Annotation;