@@ -8,7 +8,7 @@ import ReactMarkdown from 'react-markdown/with-html';
88
99import type { UserResponse } from 'stream-chat' ;
1010
11- import type { DefaultUserType , UnknownType } from '../types/types' ;
11+ import type { UnknownType } from '../types/types' ;
1212
1313export const isOnlyEmojis = ( text ?: string ) => {
1414 if ( ! text ) return false ;
@@ -107,11 +107,7 @@ const emojiMarkdownPlugin = () => {
107107 return transform ;
108108} ;
109109
110- type MentionedUser <
111- Us extends DefaultUserType < Us > = DefaultUserType
112- > = UserResponse < Us > ;
113-
114- const mentionsMarkdownPlugin = ( mentioned_users : MentionedUser [ ] ) => ( ) => {
110+ const mentionsMarkdownPlugin = ( mentioned_users : UserResponse [ ] ) => ( ) => {
115111 const mentioned_usernames = mentioned_users
116112 . map ( ( user ) => user . name || user . id )
117113 . filter ( Boolean )
@@ -142,15 +138,15 @@ const mentionsMarkdownPlugin = (mentioned_users: MentionedUser[]) => () => {
142138 return transform ;
143139} ;
144140
145- type MentionProps = { mentioned_user : MentionedUser } ;
141+ type MentionProps = { mentioned_user : UserResponse } ;
146142
147143const Mention : React . FC < MentionProps > = ( { children } ) => (
148144 < span className = 'str-chat__message-mention' > { children } </ span >
149145) ;
150146
151147export const renderText = (
152148 text ?: string ,
153- mentioned_users ?: MentionedUser [ ] ,
149+ mentioned_users ?: UserResponse [ ] ,
154150 MentionComponent : React . ComponentType < MentionProps > = Mention ,
155151) => {
156152 // take the @ mentions and turn them into markdown?
0 commit comments