aboutsummaryrefslogblamecommitdiff
path: root/vnext/src/ui/PM.js
blob: 9903b4e5e5118ae90925160974b4c82d8aee1f68 (plain) (tree)
1
2
3
4
5
6
7
8
9


                                        
                                                      
 
                    
                                    
            
            
                                                      
                                           
                                                                                                           
                      
             
 
                              
  

                                 
  
  
import React from 'react';

import Avatar from './Avatar';
import { format } from '../utils/embed';
import { chatItemStyle } from './helpers/BubbleStyle';

function PM(props) {
    const { chat, visitor } = props;
    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 React.memo(PM);
/*
PM.propTypes = {
    chat: MessageType.isRequired,
    visitor: UserType.isRequired
};
*/