1 |
c73aecde
|
Dominik Poch
|
import { Stack } from 'react-bootstrap';
|
2 |
|
|
import { AnnotationItem } from './AnnotationItem';
|
3 |
|
|
import { useContext } from 'react';
|
4 |
|
|
import { AnnotationContext } from '../../contexts/AnnotationContext';
|
5 |
b51488cd
|
Jaroslav Hrubý
|
import { Button } from 'antd';
|
6 |
c73aecde
|
Dominik Poch
|
|
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 |
b51488cd
|
Jaroslav Hrubý
|
const { mappedTags, finishAnnotation } = useContext(AnnotationContext);
|
13 |
c73aecde
|
Dominik Poch
|
|
14 |
|
|
return (
|
15 |
1ca97c68
|
Lukáš Vlček
|
<div style={{ display: 'flex', height: '100%', flexDirection: 'column' }}>
|
16 |
|
|
<div style={{ flexGrow: 1, overflowY: 'auto', marginBottom: 20 }}>
|
17 |
b51488cd
|
Jaroslav Hrubý
|
<Stack gap={2}>
|
18 |
|
|
{mappedTags?.map((tag, index) => {
|
19 |
|
|
return <AnnotationItem key={index} tag={tag} />;
|
20 |
|
|
})}
|
21 |
|
|
</Stack>
|
22 |
|
|
</div>
|
23 |
1ca97c68
|
Lukáš Vlček
|
<Button type={'primary'} onClick={finishAnnotation}>
|
24 |
|
|
Dokončit
|
25 |
|
|
</Button>
|
26 |
c73aecde
|
Dominik Poch
|
</div>
|
27 |
|
|
);
|
28 |
7652cf88
|
Lukáš Vlček
|
}
|