Skip to content

#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere

460 B
Raw Blame
import { useAppConfig } from "@editor/contexts/AppConfigContext";

export interface AiEngineState {
  enabled: boolean;
  classificationEnabled: boolean;
  loading: boolean;
}

export function useAiEngineEnabled(): AiEngineState {
  const { config, loading } = useAppConfig();
  return {
    enabled: Boolean(config?.aiEngineEnabled),
    classificationEnabled: Boolean(
      config?.aiEngineEnabled && config.aiFeatures?.classify,
    ),
    loading,
  };
}