{"version":3,"file":"MentionItem.mjs","names":[],"sources":["../../../../../../src/components/TextareaComposer/SuggestionList/MentionItem/MentionItem.tsx"],"sourcesContent":["import React from 'react';\nimport type { MentionSuggestion } from 'stream-chat';\nimport {\n  type BroadcastMentionItemProps,\n  BroadcastMentionItem as DefaultBroadcastMentionItem,\n} from './BroadcastMentionItem';\nimport { RoleItem as DefaultRoleItem, type RoleItemProps } from './RoleItem';\nimport {\n  SpecialMentionItem as DefaultSpecialMentionItem,\n  type SpecialMentionItemProps,\n} from './SpecialMentionItem';\nimport {\n  UserGroupItem as DefaultUserGroupItem,\n  type UserGroupItemProps,\n} from './UserGroupItem';\nimport { UserItem as DefaultUserItem, type UserItemProps } from './UserItem';\nimport type { MentionItemComponentProps } from './types';\n\nexport type MentionItemProps = MentionItemComponentProps<MentionSuggestion> & {\n  BroadcastMentionItem?: React.ComponentType<BroadcastMentionItemProps>;\n  RoleItem?: React.ComponentType<RoleItemProps>;\n  SpecialMentionItem?: React.ComponentType<SpecialMentionItemProps>;\n  UserGroupItem?: React.ComponentType<UserGroupItemProps>;\n  UserItem?: React.ComponentType<UserItemProps>;\n};\n\nexport const MentionItem = ({\n  BroadcastMentionItem = DefaultBroadcastMentionItem,\n  entity,\n  focused,\n  RoleItem = DefaultRoleItem,\n  SpecialMentionItem = DefaultSpecialMentionItem,\n  UserGroupItem = DefaultUserGroupItem,\n  UserItem = DefaultUserItem,\n  ...buttonProps\n}: MentionItemProps) => {\n  if (entity.mentionType === 'user') {\n    return <UserItem {...buttonProps} entity={entity} focused={focused} />;\n  }\n\n  if (entity.mentionType === 'role') {\n    return <RoleItem {...buttonProps} entity={entity} focused={focused} />;\n  }\n\n  if (entity.mentionType === 'user_group') {\n    return <UserGroupItem {...buttonProps} entity={entity} focused={focused} />;\n  }\n\n  if (entity.mentionType === 'channel' || entity.mentionType === 'here') {\n    return <BroadcastMentionItem {...buttonProps} entity={entity} focused={focused} />;\n  }\n\n  return <SpecialMentionItem {...buttonProps} entity={entity} focused={focused} />;\n};\n"],"mappings":";;;;;;;;AA0BA,IAAa,eAAe,EAC1B,sBAAA,yBAAuB,sBACvB,QACA,SACA,UAAA,aAAW,UACX,oBAAA,uBAAqB,oBACrB,eAAA,kBAAgB,eAChB,UAAA,aAAW,UACX,GAAG,kBACmB;CACtB,IAAI,OAAO,gBAAgB,QACzB,OAAO,oBAAC,YAAD;EAAU,GAAI;EAAqB;EAAiB;CAAU,CAAA;CAGvE,IAAI,OAAO,gBAAgB,QACzB,OAAO,oBAAC,YAAD;EAAU,GAAI;EAAqB;EAAiB;CAAU,CAAA;CAGvE,IAAI,OAAO,gBAAgB,cACzB,OAAO,oBAAC,iBAAD;EAAe,GAAI;EAAqB;EAAiB;CAAU,CAAA;CAG5E,IAAI,OAAO,gBAAgB,aAAa,OAAO,gBAAgB,QAC7D,OAAO,oBAAC,wBAAD;EAAsB,GAAI;EAAqB;EAAiB;CAAU,CAAA;CAGnF,OAAO,oBAAC,sBAAD;EAAoB,GAAI;EAAqB;EAAiB;CAAU,CAAA;AACjF"}