Revize b51488cd
Přidáno uživatelem Jaroslav Hrubý před téměř 3 roky(ů)
webapp/components/annotation/AnnotationPanel.tsx | ||
---|---|---|
2 | 2 |
import { AnnotationItem } from './AnnotationItem'; |
3 | 3 |
import { useContext } from 'react'; |
4 | 4 |
import { AnnotationContext } from '../../contexts/AnnotationContext'; |
5 |
import { Button } from 'antd'; |
|
5 | 6 |
|
6 | 7 |
/** |
7 | 8 |
* Creates a panel in the annotation screen that contains a list of annotations. |
8 | 9 |
* @returns Panel with a list of annotations. |
9 | 10 |
*/ |
10 | 11 |
export function AnnotationPanel() { |
11 |
const { mappedTags } = useContext(AnnotationContext); |
|
12 |
const { mappedTags, finishAnnotation } = useContext(AnnotationContext);
|
|
12 | 13 |
|
13 | 14 |
return ( |
14 | 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> |
|
15 | 23 |
<Stack gap={2}> |
16 |
{mappedTags?.map((tag, index) => {
|
|
17 |
return <AnnotationItem key={index} tag={tag} />;
|
|
18 |
})}
|
|
24 |
<Button type={'primary'} onClick={finishAnnotation}>
|
|
25 |
Dokončit
|
|
26 |
</Button>
|
|
19 | 27 |
</Stack> |
20 | 28 |
</div> |
21 | 29 |
); |
Také k dispozici: Unified diff
Annotation finishing implemented