{"version":3,"file":"AIStateIndicator.mjs","names":[],"sources":["../../../../src/components/AIStateIndicator/AIStateIndicator.tsx"],"sourcesContent":["import React from 'react';\nimport { AIStates } from 'stream-chat';\nimport type { AIState, Channel } from 'stream-chat';\n\nimport { useAIState } from './hooks/useAIState';\n\nimport { useChannel, useTranslationContext } from '../../context';\n\nexport type AIStateIndicatorProps = {\n  channel?: Channel;\n};\n\nexport const AIStateIndicator = ({\n  channel: channelFromProps,\n}: AIStateIndicatorProps) => {\n  const { t } = useTranslationContext();\n  const channelFromContext = useChannel();\n  const channel = channelFromProps || channelFromContext;\n  const { aiState } = useAIState(channel);\n  const allowedStates: Partial<Record<AIState, string>> = {\n    [AIStates.Thinking]: t('aiState.indicator.thinking.label', 'Thinking...'),\n    [AIStates.Generating]: t('aiState.indicator.generating.label', 'Generating...'),\n  };\n\n  return aiState in allowedStates ? (\n    <div className='str-chat__ai-state-indicator-container'>\n      <p className='str-chat__ai-state-indicator-text'>{allowedStates[aiState]}</p>\n    </div>\n  ) : null;\n};\n"],"mappings":";;;;;;;AAYA,IAAa,oBAAoB,EAC/B,SAAS,uBACkB;CAC3B,MAAM,EAAE,MAAM,sBAAsB;CACpC,MAAM,qBAAqB,WAAW;CAEtC,MAAM,EAAE,YAAY,WADJ,oBAAoB,kBACE;CACtC,MAAM,gBAAkD;GACrD,SAAS,WAAW,EAAE,oCAAoC,aAAa;GACvE,SAAS,aAAa,EAAE,sCAAsC,eAAe;CAChF;CAEA,OAAO,WAAW,gBAChB,oBAAC,OAAD;EAAK,WAAU;YACb,oBAAC,KAAD;GAAG,WAAU;aAAqC,cAAc;EAAY,CAAA;CACzE,CAAA,IACH;AACN"}