Projekt

Obecné

Profil

Stáhnout (744 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1 ac59aec1 Dominik Poch
/**
2
 * Creates an annotation view of a document.
3
 * @returns The annotation view.
4
 */
5 7652cf88 Lukáš Vlček
import { useContext } from 'react';
6
import { AnnotationContext } from '../../contexts/AnnotationContext';
7
import { Button } from 'antd';
8
9 6d10fe14 Dominik Poch
export function DocumentAnnotationView() {
10 7652cf88 Lukáš Vlček
    const { annotation } = useContext(AnnotationContext);
11
12
    if (!annotation) {
13
        return <p>Došlo k chybě. Anotace nebyla nalezena</p>;
14
    }
15
16 ac59aec1 Dominik Poch
    return (
17
        <div>
18 7652cf88 Lukáš Vlček
            <Button
19
                onClick={() => {
20
                    console.log(window.getSelection());
21
                }}
22
            >
23
                Test
24
            </Button>
25
            <div dangerouslySetInnerHTML={{ __html: annotation.documentText ?? '' }} />
26 ac59aec1 Dominik Poch
        </div>
27
    );
28
}