{"version":3,"file":"EventComponent.mjs","names":[],"sources":["../../../../src/components/EventComponent/EventComponent.tsx"],"sourcesContent":["import React from 'react';\n\nimport type { Event, LocalMessage } from 'stream-chat';\nimport type { TimestampFormatterOptions } from '../../i18n/types';\n\nexport type EventComponentProps = TimestampFormatterOptions & {\n  message: LocalMessage & {\n    event?: Event;\n  };\n  /**\n   * Renders `message.html`, when the message has one, instead of the text. It is inserted\n   * unescaped, so enable this only for HTML your server trusts or sanitizes.\n   */\n  unsafeHTML?: boolean;\n};\n\n/** Displays a system message; renders nothing for other message types. */\nconst UnMemoizedEventComponent = (props: EventComponentProps) => {\n  const { message, unsafeHTML = false } = props;\n  const { type } = message;\n\n  if (type !== 'system') return null;\n\n  return (\n    <div className='str-chat__message--system' data-testid='message-system'>\n      <div className='str-chat__message--system__text'>\n        {unsafeHTML && message.html ? (\n          <div\n            dangerouslySetInnerHTML={{ __html: message.html }}\n            data-unsafe-inner-html\n          />\n        ) : (\n          <span>{message.text}</span>\n        )}\n      </div>\n    </div>\n  );\n};\n\nexport const EventComponent = React.memo(\n  UnMemoizedEventComponent,\n) as typeof UnMemoizedEventComponent;\n"],"mappings":";;;;AAiBA,IAAM,4BAA4B,UAA+B;CAC/D,MAAM,EAAE,SAAS,aAAa,UAAU;CACxC,MAAM,EAAE,SAAS;CAEjB,IAAI,SAAS,UAAU,OAAO;CAE9B,OACE,oBAAC,OAAD;EAAK,WAAU;EAA4B,eAAY;YACrD,oBAAC,OAAD;GAAK,WAAU;aACZ,cAAc,QAAQ,OACrB,oBAAC,OAAD;IACE,yBAAyB,EAAE,QAAQ,QAAQ,KAAK;IAChD,0BAAA;GACD,CAAA,IAED,oBAAC,QAAD,EAAA,UAAO,QAAQ,KAAW,CAAA;EAEzB,CAAA;CACF,CAAA;AAET;AAEA,IAAa,iBAAiB,MAAM,KAClC,wBACF"}