Revize 7652cf88
Přidáno uživatelem Lukáš Vlček před asi 2 roky(ů)
webapp/components/annotation/DocumentAnnotationView.tsx | ||
---|---|---|
2 | 2 |
* Creates an annotation view of a document. |
3 | 3 |
* @returns The annotation view. |
4 | 4 |
*/ |
5 |
import { useContext } from 'react'; |
|
6 |
import { AnnotationContext } from '../../contexts/AnnotationContext'; |
|
7 |
import { Button } from 'antd'; |
|
8 |
|
|
5 | 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 |
|
|
6 | 16 |
return ( |
7 | 17 |
<div> |
8 |
<p>Main view with a rendered document</p> |
|
18 |
<Button |
|
19 |
onClick={() => { |
|
20 |
console.log(window.getSelection()); |
|
21 |
}} |
|
22 |
> |
|
23 |
Test |
|
24 |
</Button> |
|
25 |
<div dangerouslySetInnerHTML={{ __html: annotation.documentText ?? '' }} /> |
|
9 | 26 |
</div> |
10 | 27 |
); |
11 | 28 |
} |
Také k dispozici: Unified diff
Basic annotation document preview