Projekt

Obecné

Profil

Stáhnout (1.19 KB) Statistiky
| Větev: | Tag: | Revize:
1
import { Stack } from 'react-bootstrap';
2
import { AnnotationItem } from './AnnotationItem';
3
import { useContext } from 'react';
4
import { AnnotationContext } from '../../contexts/AnnotationContext';
5
import { Tag } from '../types/tag';
6

    
7
/**
8
 * Creates a panel in the annotation screen that contains a list of annotations.
9
 * @returns Panel with a list of annotations.
10
 */
11
export function AnnotationPanel() {
12
    //const { tags } = useContext(AnnotationContext);
13

    
14
    const tags: Tag[] = [
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
    return (
36
        <div>
37
            <Stack>
38
                {tags?.map((tag, index) => {
39
                    return <AnnotationItem key={index} tag={tag} />;
40
                })}
41
            </Stack>
42
        </div>
43
    );
44
}
(2-2/4)