Projekt

Obecné

Profil

Stáhnout (1.5 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 7595035c Lukáš Vlček
import { useRouter } from 'next/router';
9 6d10fe14 Dominik Poch
10
/**
11
 * Creates an annotation screen.
12
 * @returns The annotation screen.
13
 */
14
function Annotation() {
15 7595035c Lukáš Vlček
    const router = useRouter();
16 7652cf88 Lukáš Vlček
    const { id } = router.query;
17 7595035c Lukáš Vlček
18 7652cf88 Lukáš Vlček
    if (!id || typeof id !== 'string') {
19
        /*(async () => {
20 7595035c Lukáš Vlček
            await router.push('/documents');
21 7652cf88 Lukáš Vlček
        })(); // TODO*/
22
23
        return <p>Načítání...</p>;
24 7595035c Lukáš Vlček
    }
25
26 7652cf88 Lukáš Vlček
    const annotationId: string = Array.isArray(id) ? id[0] : id;
27 7595035c Lukáš Vlček
28 6d10fe14 Dominik Poch
    return (
29 7595035c Lukáš Vlček
        <AnnotationProvider annotationId={annotationId}>
30 c057279b Lukáš Vlček
            <MainLayout>
31 c73aecde Dominik Poch
                <div className={styles.layoutWrapper}>
32 c057279b Lukáš Vlček
                    <div className={styles.tags}>
33
                        <TagPanel />
34
                    </div>
35
                    <div className={styles.document}>
36
                        <DocumentAnnotationView />
37
                    </div>
38
                    <div className={styles.annotations}>
39 c73aecde Dominik Poch
                        <AnnotationPanel />
40 c057279b Lukáš Vlček
                    </div>
41 ce63b2ab Dominik Poch
                </div>
42 c057279b Lukáš Vlček
            </MainLayout>
43
        </AnnotationProvider>
44 6d10fe14 Dominik Poch
    );
45
}
46
47
export default Annotation;