-
Notifications
You must be signed in to change notification settings - Fork 298
Expand file tree
/
Copy pathMessageBlocked.tsx
More file actions
34 lines (29 loc) · 967 Bytes
/
MessageBlocked.tsx
File metadata and controls
34 lines (29 loc) · 967 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React from 'react';
import clsx from 'clsx';
import { useUserRole } from './hooks/useUserRole';
import { useTranslationContext } from '../../context/TranslationContext';
import { useMessageContext } from '../../context';
export const MessageBlocked = () => {
const { message } = useMessageContext();
const { t } = useTranslationContext('MessageBlocked');
const { isMyMessage } = useUserRole(message);
const messageClasses = clsx(
'str-chat__message str-chat__message-simple str-chat__message--blocked',
message.type,
{
'str-chat__message--me str-chat__message-simple--me': isMyMessage,
'str-chat__message--other': !isMyMessage,
},
);
return (
<div
className={messageClasses}
data-testid='message-blocked-component'
key={message.id}
>
<div className='str-chat__message--blocked-inner'>
{t<string>('Message was blocked by moderation policies')}
</div>
</div>
);
};