/
vshmidt
/
label-studio
Обзор
Документация
Войти
/
vshmidt
/
label-studio
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
web/libs/editor/src/components/AnnotationTab/DynamicPreannotationsToggle.jsx
40 строк
1 KB
Raul Martin
feat: Migrate SCSS to plain CSS with PostCSS, replace Stylelint with Biome (#9584)
12 мар 2026, 20:57
Не верифицирован
12 мар 2026, 20:57
3f31128
Код
Авторство
О чём код?
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; }), );