Spaces:
Configuration error
Configuration error
Download web/libs/editor/src/components/AnnotationTab/DynamicPreannotationsToggle.jsx from bisalsaha/lebel-studio: direct link, hf CLI and curl.
- Browser
- Download file 1.32 kB
-
https://huggingface.co/spaces/bisalsaha/lebel-studio/resolve/main/web/libs/editor/src/components/AnnotationTab/DynamicPreannotationsToggle.jsx
- Command line
-
hf download hf://spaces/bisalsaha/lebel-studio/web/libs/editor/src/components/AnnotationTab/DynamicPreannotationsToggle.jsx
-
curl -L -o DynamicPreannotationsToggle.jsx https://huggingface.co/spaces/bisalsaha/lebel-studio/resolve/main/web/libs/editor/src/components/AnnotationTab/DynamicPreannotationsToggle.jsx
1.32 kB
| import { inject, observer } from "mobx-react"; | |
| import { useEffect } from "react"; | |
| import { Space } from "../../common/Space/Space"; | |
| import { Toggle } from "@humansignal/ui"; | |
| import ToolsManager from "../../tools/Manager"; | |
| import { cn } from "../../utils/bem"; | |
| import "./DynamicPreannotationsToggle.prefix.css"; | |
| export const DynamicPreannotationsToggle = inject("store")( | |
| observer(({ store }) => { | |
| const enabled = store.hasInterface("auto-annotation") && !store.forceAutoAnnotation; | |
| useEffect(() => { | |
| if (!enabled) store.setAutoAnnotation(false); | |
| }, [enabled]); | |
| return enabled ? ( | |
| <div className={cn("dynamic-preannotations").toClassName()}> | |
| <div className={cn("dynamic-preannotations").elem("wrapper").toClassName()}> | |
| <Space spread> | |
| <Toggle | |
| checked={store.autoAnnotation} | |
| onChange={(e) => { | |
| const checked = e.target.checked; | |
| store.setAutoAnnotation(checked); | |
| if (!checked) { | |
| ToolsManager.allInstances().forEach((inst) => inst.selectDefault()); | |
| } | |
| }} | |
| label="Auto-Annotation" | |
| data-testid="bottombar-auto-annotation-toggle" | |
| /> | |
| </Space> | |
| </div> | |
| </div> | |
| ) : null; | |
| }), | |
| ); | |