Skip to content

The open alternative to Salesforce, designed for AI.

562 B
Raw Blame
import { aiModelsState } from '@/client-config/states/aiModelsState';
import { useAtomStateValue } from '@/ui/utilities/state/jotai/hooks/useAtomStateValue';
import { useIsFeatureEnabled } from '@/workspace/hooks/useIsFeatureEnabled';
import { FeatureFlagKey } from '~/generated-metadata/graphql';

export const useCanSendAgentChatMessage = () => {
  const aiModels = useAtomStateValue(aiModelsState);
  const isAiChatInboxEnabled = useIsFeatureEnabled(
    FeatureFlagKey.IS_AI_CHAT_INBOX_ENABLED,
  );

  return aiModels.length > 0 || isAiChatInboxEnabled;
};