Add bot user badge. Closes #2681
This commit is contained in:
@@ -14,6 +14,7 @@ import { accessTokenAtom } from '../../stores/ClientConfigStore';
|
||||
import { User } from '../../../interfaces/user.model';
|
||||
import { AuthedUserBadge } from '../ChatUserBadge/AuthedUserBadge';
|
||||
import { ModerationBadge } from '../ChatUserBadge/ModerationBadge';
|
||||
import { BotUserBadge } from '../ChatUserBadge/BotUserBadge';
|
||||
|
||||
// Lazy loaded components
|
||||
|
||||
@@ -35,6 +36,7 @@ export type ChatUserMessageProps = {
|
||||
sameUserAsLast: boolean;
|
||||
isAuthorModerator: boolean;
|
||||
isAuthorAuthenticated: boolean;
|
||||
isAuthorBot: boolean;
|
||||
};
|
||||
|
||||
export type UserTooltipProps = {
|
||||
@@ -61,6 +63,7 @@ export const ChatUserMessage: FC<ChatUserMessageProps> = ({
|
||||
sameUserAsLast,
|
||||
isAuthorModerator,
|
||||
isAuthorAuthenticated,
|
||||
isAuthorBot,
|
||||
}) => {
|
||||
const { id: messageId, body, user, timestamp } = message;
|
||||
const { id: userId, displayName, displayColor } = user;
|
||||
@@ -76,7 +79,9 @@ export const ChatUserMessage: FC<ChatUserMessageProps> = ({
|
||||
if (isAuthorAuthenticated) {
|
||||
badgeNodes.push(<AuthedUserBadge key="auth" userColor={displayColor} />);
|
||||
}
|
||||
|
||||
if (isAuthorBot) {
|
||||
badgeNodes.push(<BotUserBadge key="bot" userColor={displayColor} />);
|
||||
}
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
|
||||
Reference in New Issue
Block a user