Skip to content

The open alternative to Salesforce, designed for AI.

308 B
Raw Blame
import { isDefined } from 'twenty-shared/utils';

import { type AiChatUserCreditsUsage } from '@/ai/types/AiChatUserCreditsUsage';

export const isAiChatUserCreditsExhausted = ({
  limitValue,
  consumedValue,
}: AiChatUserCreditsUsage): boolean =>
  isDefined(consumedValue) && consumedValue >= limitValue;