Projekt

Obecné

Profil

Stáhnout (1013 Bajtů) 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 { Button } from 'antd';
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 { mappedTags, finishAnnotation } = useContext(AnnotationContext);
13

    
14
    return (
15
        <div>
16
            <div style={{ height: '80vh', overflowY: 'auto', marginBottom: 20 }}>
17
                <Stack gap={2}>
18
                    {mappedTags?.map((tag, index) => {
19
                        return <AnnotationItem key={index} tag={tag} />;
20
                    })}
21
                </Stack>
22
            </div>
23
            <Stack gap={2}>
24
                <Button type={'primary'} onClick={finishAnnotation}>
25
                    Dokončit
26
                </Button>
27
            </Stack>
28
        </div>
29
    );
30
}
(2-2/7)