|
1 | 1 | import { Button, ButtonGroup, Icon, IconButton, Stack, Text as ChakraText, Tooltip } from '@chakra-ui/react';
|
2 | 2 | import React from 'react';
|
3 |
| -import { FaCheck, FaFlag, FaQuestion, FaTimes, FaTrash, FaWrench } from 'react-icons/fa'; |
| 3 | +import { FaCheck, FaFlag, FaQuestion, FaRobot, FaTimes, FaTrash, FaUser, FaWrench } from 'react-icons/fa'; |
4 | 4 | import { useAppDispatch, useAppSelector } from '../../app/hooks';
|
5 | 5 | import {
|
6 | 6 | removeBoundaryAnnotation,
|
@@ -35,6 +35,7 @@ import {
|
35 | 35 | selectRemoveAnnotation,
|
36 | 36 | selectRenameAnnotation,
|
37 | 37 | selectTodoAnnotation,
|
| 38 | + selectUsername, |
38 | 39 | selectUsernameIsValid,
|
39 | 40 | selectValueAnnotation,
|
40 | 41 | } from './annotationSlice';
|
@@ -332,6 +333,14 @@ const AnnotationTag: React.FC<AnnotationTagProps> = function ({
|
332 | 333 |
|
333 | 334 | const authors = annotation.authors ?? [];
|
334 | 335 | const authorText = createAuthorText(authors);
|
| 336 | + const username = useAppSelector(selectUsername); |
| 337 | + |
| 338 | + let rightIcon; |
| 339 | + if (authors.includes(username)) { |
| 340 | + rightIcon = <FaUser />; |
| 341 | + } else if (authors.length === 1 && authors[0] === '$autogen$') { |
| 342 | + rightIcon = <FaRobot />; |
| 343 | + } |
335 | 344 |
|
336 | 345 | const isReportable = reportable && authors.length === 1 && authors.includes('$autogen$');
|
337 | 346 |
|
@@ -375,6 +384,7 @@ const AnnotationTag: React.FC<AnnotationTagProps> = function ({
|
375 | 384 | <Tooltip label={`${authorText}Click to change.`}>
|
376 | 385 | <Button
|
377 | 386 | leftIcon={<FaWrench />}
|
| 387 | + rightIcon={rightIcon} |
378 | 388 | flexGrow={1}
|
379 | 389 | borderLeft="none"
|
380 | 390 | justifyContent="flex-start"
|
|
0 commit comments