Projekt

Obecné

Profil

Stáhnout (744 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1
/**
2
 * Creates an annotation view of a document.
3
 * @returns The annotation view.
4
 */
5
import { useContext } from 'react';
6
import { AnnotationContext } from '../../contexts/AnnotationContext';
7
import { Button } from 'antd';
8

    
9
export function DocumentAnnotationView() {
10
    const { annotation } = useContext(AnnotationContext);
11

    
12
    if (!annotation) {
13
        return <p>Došlo k chybě. Anotace nebyla nalezena</p>;
14
    }
15

    
16
    return (
17
        <div>
18
            <Button
19
                onClick={() => {
20
                    console.log(window.getSelection());
21
                }}
22
            >
23
                Test
24
            </Button>
25
            <div dangerouslySetInnerHTML={{ __html: annotation.documentText ?? '' }} />
26
        </div>
27
    );
28
}
(3-3/4)