1
|
import { CategoryItem } from './CategoryItem';
|
2
|
import { TagCategoryInfo } from '../../api';
|
3
|
import { Stack } from 'react-bootstrap';
|
4
|
import { useContext } from 'react';
|
5
|
import { TagCategoryContext } from '../../contexts/TagCategoryContext';
|
6
|
|
7
|
/**
|
8
|
* Creates a panel in the annotation screen that contains a list of tag.
|
9
|
* @returns Panel with a list of tags.
|
10
|
*/
|
11
|
export function TagPanel() {
|
12
|
const { tagCategories } = useContext(TagCategoryContext);
|
13
|
|
14
|
return (
|
15
|
<div>
|
16
|
<Stack>
|
17
|
{tagCategories?.map((category, index) => (
|
18
|
<CategoryItem category={category} key={index} />
|
19
|
))}
|
20
|
</Stack>
|
21
|
</div>
|
22
|
);
|
23
|
}
|