UNPKG

globalbridge-lsf-custom

Version:

GlobalBridge in-house labeling tool, originating from LSF.

42 lines (37 loc) • 1.37 kB
import { observer } from 'mobx-react'; import { LsStar, LsStarOutline } from '../../assets/icons'; import { Button } from '../../common/Button/Button'; import { Tooltip } from '../../common/Tooltip/Tooltip'; import { BemWithSpecificContext } from '../../utils/bem'; // import { FF_DEV_3873, isFF } from '../../utils/feature-flags'; import './GroundTruth.styl'; // My props const isNewUIEnabled = true; const { Block, Elem } = BemWithSpecificContext(); export const GroundTruth = observer(({ entity, disabled = false, size = 'md' }) => { const title = entity.ground_truth ? 'Unset this result as a ground truth' : 'Set this result as a ground truth'; return (!entity.skipped && !entity.userGenerate && entity.type !== 'prediction') && ( <Block name="ground-truth" mod={{ disabled, size }}> <Tooltip placement="topLeft" title={title}> <Elem tag={Button} name="toggle" size="small" type="link" onClick={ev => { ev.preventDefault(); entity.setGroundTruth(!entity.ground_truth); }} > <Elem name="indicator" tag={isNewUIEnabled && !entity.ground_truth ? LsStarOutline : LsStar} mod={{ active: entity.ground_truth, dark: isNewUIEnabled }} /> </Elem> </Tooltip> </Block> ); });