import { inject, observer } from "mobx-react"; import { IconCheck, IconCross } from "@humansignal/icons"; import { Button, Toggle } from "@humansignal/ui"; import { Space } from "../../common/Space/Space"; import { cn } from "../../utils/bem"; import "./AutoAcceptToggle.prefix.css"; // we need to inject all of them to trigger rerender on changes to suggestions const injector = inject(({ store }) => { const annotation = store.annotationStore?.selected; const suggestions = annotation?.suggestions; return { store, annotation, suggestions, }; }); export const AutoAcceptToggle = injector( observer(({ store, annotation, suggestions }) => { if (!store.autoAnnotation) return null; const withSuggestions = annotation.hasSuggestionsSupport && !store.forceAutoAcceptSuggestions; const loading = store.awaitingSuggestions; return (