Skip to content
This repository was archived by the owner on Jan 19, 2025. It is now read-only.
12 changes: 11 additions & 1 deletion api-editor/gui/src/features/annotations/AnnotationView.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button, ButtonGroup, Icon, IconButton, Stack, Text as ChakraText, Tooltip } from '@chakra-ui/react';
import React from 'react';
import { FaCheck, FaFlag, FaQuestion, FaTimes, FaTrash, FaWrench } from 'react-icons/fa';
import { FaCheck, FaFlag, FaQuestion, FaRobot, FaTimes, FaTrash, FaUser, FaWrench } from 'react-icons/fa';
import { useAppDispatch, useAppSelector } from '../../app/hooks';
import {
removeBoundaryAnnotation,
Expand Down Expand Up @@ -35,6 +35,7 @@ import {
selectRemoveAnnotation,
selectRenameAnnotation,
selectTodoAnnotation,
selectUsername,
selectUsernameIsValid,
selectValueAnnotation,
} from './annotationSlice';
Expand Down Expand Up @@ -332,6 +333,14 @@ const AnnotationTag: React.FC<AnnotationTagProps> = function ({

const authors = annotation.authors ?? [];
const authorText = createAuthorText(authors);
const username = useAppSelector(selectUsername);

let rightIcon;
if (authors.includes(username)) {
rightIcon = <FaUser />;
} else if (authors.length === 1 && authors[0] === '$autogen$') {
rightIcon = <FaRobot />;
}

const isReportable = reportable && authors.length === 1 && authors.includes('$autogen$');

Expand Down Expand Up @@ -375,6 +384,7 @@ const AnnotationTag: React.FC<AnnotationTagProps> = function ({
<Tooltip label={`${authorText}Click to change.`}>
<Button
leftIcon={<FaWrench />}
rightIcon={rightIcon}
flexGrow={1}
borderLeft="none"
justifyContent="flex-start"
Expand Down