|
|
|
@ -7,7 +7,6 @@ import useConversationStore from '@/stores/ConversationStore';
|
|
|
|
|
import { useShallow } from 'zustand/react/shallow';
|
|
|
|
|
import { WABIcon } from '@/components/Icons';
|
|
|
|
|
import ChannelLogo from './ChannelLogo';
|
|
|
|
|
import { WABAccountsMapped } from '@/channel/bubbleMsgUtils';
|
|
|
|
|
|
|
|
|
|
const BubbleIM = ({ handlePreview, handleContactClick, setNewChatModalVisible, setNewChatFormValues, scrollToMessage, focusMsg, ...message }) => {
|
|
|
|
|
const { message: appMessage } = App.useApp();
|
|
|
|
@ -44,7 +43,6 @@ const BubbleIM = ({ handlePreview, handleContactClick, setNewChatModalVisible, s
|
|
|
|
|
return prev;
|
|
|
|
|
}, []);
|
|
|
|
|
|
|
|
|
|
const receivedMsgFooter = message.sender === 'me' ? '' : WABAccountsMapped[message.msgOrigin.to]?.verifiedName;
|
|
|
|
|
return (
|
|
|
|
|
<span className={`text-sm leading-5 emoji-text whitespace-pre-wrap ${className} ${extraClass}`} key={'msg-text'}>
|
|
|
|
|
{headerObj ? (
|
|
|
|
@ -77,12 +75,6 @@ const BubbleIM = ({ handlePreview, handleContactClick, setNewChatModalVisible, s
|
|
|
|
|
}
|
|
|
|
|
})}
|
|
|
|
|
{footerObj ? <div className=' text-neutral-500'>{footerObj.text}</div> : null}
|
|
|
|
|
{receivedMsgFooter ? (
|
|
|
|
|
<div className='text-right border-0 pt-[2px] border-t-slate-200 border-t border-solid text-xs text-neutral-500'>
|
|
|
|
|
<ChannelLogo channel={message.msg_source} className='text-xs w-3 h-3 ' />
|
|
|
|
|
<span className='italic'>{receivedMsgFooter}</span>
|
|
|
|
|
</div>
|
|
|
|
|
) : null}
|
|
|
|
|
{buttonsArr && buttonsArr.length > 0 ? (
|
|
|
|
|
<div className='flex flex-row gap-1'>
|
|
|
|
|
{buttonsArr.map((btn, index) =>
|
|
|
|
@ -122,10 +114,11 @@ const BubbleIM = ({ handlePreview, handleContactClick, setNewChatModalVisible, s
|
|
|
|
|
// styles: { backgroundColor: '#ccd4ae' },
|
|
|
|
|
notchStyle: { fill: '#ccd4ae' }, // todo: channel[WhatsApp] color '#d9fdd3'
|
|
|
|
|
replyButton: ['text', 'document', 'image'].includes(message.whatsapp_msg_type) && message.status !== 'failed' ? true : false,
|
|
|
|
|
title: <><ChannelLogo channel={message.msg_source} /> {WABAccountsMapped[message.from]?.verifiedName}</>,
|
|
|
|
|
title: <><ChannelLogo channel={message.msg_source} /> {message.wabaName}</>,
|
|
|
|
|
}
|
|
|
|
|
: {
|
|
|
|
|
// title: <> <ChannelLogo channel={message.msg_source} /> {message.title}</>,
|
|
|
|
|
dateString: `${message.wabaName} - ${message.dateString}`,
|
|
|
|
|
})}
|
|
|
|
|
className={[
|
|
|
|
|
'whitespace-pre-wrap',
|
|
|
|
|