Projekt

Obecné

Profil

Stáhnout (1018 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 style={{ display: 'flex', height: '100%', flexDirection: 'column' }}>
16
            <div style={{ flexGrow: 1, 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
            <Button type={'primary'} onClick={finishAnnotation}>
24
                Dokončit
25
            </Button>
26
        </div>
27
    );
28
}
(3-3/8)