blob: d5a7eff19fe3d9f98d0cc41434470357514e19c7 (
plain) (
blame)
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
|
import { memo } from 'react';
import Avatar from './Avatar';
import { format } from '../utils/embed';
import { chatItemStyle } from './helpers/BubbleStyle';
import { useVisitor } from './VisitorContext';
function PM(props) {
const { chat } = props;
const [visitor] = useVisitor();
return (
<li>
<div style={chatItemStyle(visitor, chat)}>
<Avatar user={chat.user} />
<div className={visitor.uid === chat.user.uid ? 'msg-bubble msg-bubble-my' : 'msg-bubble'}>
<p dangerouslySetInnerHTML={{ __html: format(chat.body, '0', false) }} />
</div>
</div>
</li>
);
}
export default memo(PM);
/*
PM.propTypes = {
chat: MessageType.isRequired
};
*/
|