Projekt

Obecné

Profil

Stáhnout (702 Bajtů) Statistiky
| Větev: | Tag: | Revize:
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 gap={1}>
17
                {tagCategories?.map((category, index) => (
18
                    <CategoryItem category={category} key={index} />
19
                ))}
20
            </Stack>
21
        </div>
22
    );
23
}
(7-7/7)