{"version":3,"file":"EmptyStateIndicator.mjs","names":[],"sources":["../../../../src/components/EmptyStateIndicator/EmptyStateIndicator.tsx"],"sourcesContent":["import React from 'react';\n\nimport { useTranslationContext } from '../../context/TranslationContext';\nimport { useComponentContextIcons } from '../../context';\nimport { asDynamicKey } from '../../i18n/utils';\n\nexport type EmptyStateIndicatorProps = {\n  /** Which list is empty. A 'thread' list renders nothing. */\n  listType?: 'channel' | 'message' | 'thread';\n  messageText?: string;\n};\n\nconst UnMemoizedEmptyStateIndicator = (props: EmptyStateIndicatorProps) => {\n  const { listType, messageText } = props;\n\n  const { t } = useTranslationContext();\n  const { IconMessageBubble, IconMessageBubbles } = useComponentContextIcons();\n\n  if (listType === 'thread') return null;\n\n  if (listType === 'channel') {\n    const text = t(\n      'emptyState.indicator.noConversationsYet.label',\n      'No conversations yet',\n    );\n    return (\n      <div className='str-chat__channel-list-empty'>\n        <IconMessageBubbles />\n        <p role='listitem'>{text}</p>\n      </div>\n    );\n  }\n\n  if (listType === 'message') {\n    // `messageText` is integrator-supplied and may be a translation key, so it goes through `t`\n    // as-is; only the built-in default has a key and inline copy.\n    const text = messageText\n      ? t(asDynamicKey(messageText))\n      : t(\n          'emptyState.indicator.startConversation.label',\n          'Send a message to start the conversation',\n        );\n    return (\n      <div className='str-chat__empty-channel'>\n        <IconMessageBubble />\n        <p className='str-chat__empty-channel-text' role='listitem'>\n          {text}\n        </p>\n      </div>\n    );\n  }\n\n  return <p>{t('emptyState.indicator.noItemsExist.text', 'No items exist')}</p>;\n};\n\nexport const EmptyStateIndicator = React.memo(\n  UnMemoizedEmptyStateIndicator,\n) as typeof UnMemoizedEmptyStateIndicator;\n"],"mappings":";;;;;;AAYA,IAAM,iCAAiC,UAAoC;CACzE,MAAM,EAAE,UAAU,gBAAgB;CAElC,MAAM,EAAE,MAAM,sBAAsB;CACpC,MAAM,EAAE,mBAAmB,uBAAuB,yBAAyB;CAE3E,IAAI,aAAa,UAAU,OAAO;CAElC,IAAI,aAAa,WAAW;EAC1B,MAAM,OAAO,EACX,iDACA,sBACF;EACA,OACE,qBAAC,OAAD;GAAK,WAAU;aAAf,CACE,oBAAC,oBAAD,CAAqB,CAAA,GACrB,oBAAC,KAAD;IAAG,MAAK;cAAY;GAAQ,CAAA,CACzB;;CAET;CAEA,IAAI,aAAa,WAAW;EAG1B,MAAM,OAAO,cACT,EAAE,aAAa,WAAW,CAAC,IAC3B,EACE,gDACA,0CACF;EACJ,OACE,qBAAC,OAAD;GAAK,WAAU;aAAf,CACE,oBAAC,mBAAD,CAAoB,CAAA,GACpB,oBAAC,KAAD;IAAG,WAAU;IAA+B,MAAK;cAC9C;GACA,CAAA,CACA;;CAET;CAEA,OAAO,oBAAC,KAAD,EAAA,UAAI,EAAE,0CAA0C,gBAAgB,EAAK,CAAA;AAC9E;AAEA,IAAa,sBAAsB,MAAM,KACvC,6BACF"}