Revize a80db039
Přidáno uživatelem Dominik Poch před asi 3 roky(ů)
webapp/pages/annotation/index.tsx | ||
---|---|---|
4 | 4 |
import { MainLayout } from '../../layouts/mainLayout'; |
5 | 5 |
import 'antd/dist/antd.css'; |
6 | 6 |
import styles from '/styles/annotation.module.scss'; |
7 |
import { Occurrence, Tag } from '../../components/models/tag'; |
|
7 | 8 | |
8 | 9 |
/** |
9 | 10 |
* Creates an annotation screen. |
10 | 11 |
* @returns The annotation screen. |
11 | 12 |
*/ |
12 | 13 |
function Annotation() { |
14 |
const tags = [ |
|
15 |
{ |
|
16 |
name: 'tag a', |
|
17 |
category: 'kategorie 1', |
|
18 |
visible: true, |
|
19 |
occurrences: [ |
|
20 |
{ position: 2, length: 5 }, |
|
21 |
{ position: 10, length: 2 }, |
|
22 |
], |
|
23 |
}, |
|
24 |
{ |
|
25 |
name: 'tag b', |
|
26 |
category: 'kategorie 2', |
|
27 |
visible: true, |
|
28 |
occurrences: [ |
|
29 |
{ position: 546, length: 432 }, |
|
30 |
{ position: 767, length: 123 }, |
|
31 |
], |
|
32 |
}, |
|
33 |
]; |
|
34 | ||
35 |
const addOccurrence = () => {}; |
|
36 | ||
37 |
const changeVisibility = (tag: Tag) => {}; |
|
38 | ||
39 |
const deleteOccurrence = (occurrence: Occurrence) => {}; |
|
40 | ||
41 |
const changePosition = (occurrence: Occurrence, newValue: number) => {}; |
|
42 | ||
43 |
const changeLength = (occurrence: Occurrence, newValue: number) => {}; |
|
44 | ||
13 | 45 |
return ( |
14 | 46 |
<MainLayout> |
15 | 47 |
<div className={styles.layoutwrapper}> |
... | ... | |
20 | 52 |
<DocumentAnnotationView /> |
21 | 53 |
</div> |
22 | 54 |
<div className={styles.annotations}> |
23 |
<AnnotationPanel /> |
|
55 |
<AnnotationPanel |
|
56 |
tags={tags} |
|
57 |
onAddOccurrence={addOccurrence} |
|
58 |
onChangeVisibility={changeVisibility} |
|
59 |
onDeleteOccurrence={deleteOccurrence} |
|
60 |
onChangePosition={changePosition} |
|
61 |
onChangeLength={changeLength} |
|
62 |
/> |
|
24 | 63 |
</div> |
25 | 64 |
</div> |
26 | 65 |
</MainLayout> |
Také k dispozici: Unified diff
Initialization of tags in annotation view
Initialized tags and created event handlers in the annotation view