Spaces:
Configuration error
Configuration error
Download web/libs/editor/src/components/AnnotationTabs/AnnotationTabs.jsx from bisalsaha/lebel-studio: direct link, hf CLI and curl.
- Browser
- Download file 2.02 kB
-
https://huggingface.co/spaces/bisalsaha/lebel-studio/resolve/main/web/libs/editor/src/components/AnnotationTabs/AnnotationTabs.jsx
- Command line
-
hf download hf://spaces/bisalsaha/lebel-studio/web/libs/editor/src/components/AnnotationTabs/AnnotationTabs.jsx
-
curl -L -o AnnotationTabs.jsx https://huggingface.co/spaces/bisalsaha/lebel-studio/resolve/main/web/libs/editor/src/components/AnnotationTabs/AnnotationTabs.jsx
2.02 kB
| import { forwardRef } from "react"; | |
| import { observer } from "mobx-react"; | |
| import { IconBan, IconSparks, IconStar } from "@humansignal/icons"; | |
| import { Userpic } from "@humansignal/ui"; | |
| import { Space } from "../../common/Space/Space"; | |
| import { cn } from "../../utils/bem"; | |
| import "./AnnotationTabs.prefix.css"; | |
| export const EntityTab = observer( | |
| forwardRef( | |
| ({ entity, selected, style, onClick, bordered = true, prediction = false, displayGroundTruth = false }, ref) => { | |
| const isUnsaved = (entity.userGenerate && !entity.sentUserGenerate) || entity.draftSelected; | |
| const infoIsHidden = entity.store.hasInterface("annotations:hide-info"); | |
| return ( | |
| <div | |
| ref={ref} | |
| data-annotation-id={entity.pk ?? entity.id} | |
| className={cn("entity-tab").mod({ selected, bordered }).toClassName()} | |
| style={style} | |
| onClick={(e) => { | |
| e.preventDefault(); | |
| e.stopPropagation(); | |
| if (onClick) onClick(entity, prediction); | |
| }} | |
| > | |
| <Space size="small"> | |
| <Userpic | |
| className={cn("entity-tab").elem("userpic").mod({ prediction }).toClassName()} | |
| showUsernameTooltip | |
| username={prediction ? entity.createdBy : null} | |
| user={infoIsHidden ? {} : (entity.user ?? { email: entity.createdBy })} | |
| > | |
| {prediction && <IconSparks style={{ width: 16, height: 16 }} />} | |
| </Userpic> | |
| {!infoIsHidden && ( | |
| <div className={cn("entity-tab").elem("identifier").toClassName()}> | |
| ID {entity.pk ?? entity.id} {isUnsaved && "*"} | |
| </div> | |
| )} | |
| {displayGroundTruth && entity.ground_truth && ( | |
| <IconStar className={cn("entity-tab").elem("ground-truth").toClassName()} /> | |
| )} | |
| {entity.skipped && <IconBan className={cn("entity-tab").elem("skipped").toClassName()} />} | |
| </Space> | |
| </div> | |
| ); | |
| }, | |
| ), | |
| ); | |