{"version":3,"file":"MessageAlsoSentInChannelIndicator.mjs","names":[],"sources":["../../../../src/components/Message/MessageAlsoSentInChannelIndicator.tsx"],"sourcesContent":["import React from 'react';\n\nimport { useComponentContextIcons, useTranslationContext } from '../../context';\nimport { useMessageAlsoSentInChannelNavigation } from './hooks';\n\nexport type MessageAlsoSentInChannelIndicatorProps = {\n  /**\n   * Overrides the \"View\" click handler. Defaults to\n   * `useMessageAlsoSentInChannelNavigation().viewReference`. May return a promise.\n   */\n  onView?: () => void | Promise<void>;\n};\n\n/**\n * Indicator for a message that is also shown in the channel (`show_in_channel`). Navigation comes\n * from {@link useMessageAlsoSentInChannelNavigation}.\n */\nexport const MessageAlsoSentInChannelIndicator = ({\n  onView,\n}: MessageAlsoSentInChannelIndicatorProps = {}) => {\n  const { IconArrowUpRight } = useComponentContextIcons();\n  const { t } = useTranslationContext();\n  const { isInThread, isShownInChannel, viewReference } =\n    useMessageAlsoSentInChannelNavigation();\n\n  if (!isShownInChannel) return null;\n\n  return (\n    <div className='str-chat__message-also-sent-in-channel' role='status'>\n      <IconArrowUpRight />\n      <span>\n        {isInThread\n          ? t('message.alsoSent.alsoSentChannel.text', 'Also sent in channel')\n          : t('message.alsoSent.repliedThread.text', 'Replied to a thread')}\n      </span>\n      <span> · </span>\n      <button\n        className='str-chat__message-also-sent-in-channel__link-button'\n        onClick={onView ?? viewReference}\n        type='button'\n      >\n        {t('message.alsoSent.view.text', 'View')}\n      </button>\n    </div>\n  );\n};\n"],"mappings":";;;;;;;;;;AAiBA,IAAa,qCAAqC,EAChD,WAC0C,CAAC,MAAM;CACjD,MAAM,EAAE,qBAAqB,yBAAyB;CACtD,MAAM,EAAE,MAAM,sBAAsB;CACpC,MAAM,EAAE,YAAY,kBAAkB,kBACpC,sCAAsC;CAExC,IAAI,CAAC,kBAAkB,OAAO;CAE9B,OACE,qBAAC,OAAD;EAAK,WAAU;EAAyC,MAAK;YAA7D;GACE,oBAAC,kBAAD,CAAmB,CAAA;GACnB,oBAAC,QAAD,EAAA,UACG,aACG,EAAE,yCAAyC,sBAAsB,IACjE,EAAE,uCAAuC,qBAAqB,EAC9D,CAAA;GACN,oBAAC,QAAD,EAAA,UAAM,MAAS,CAAA;GACf,oBAAC,UAAD;IACE,WAAU;IACV,SAAS,UAAU;IACnB,MAAK;cAEJ,EAAE,8BAA8B,MAAM;GACjC,CAAA;EACL;;AAET"}