|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import { useEffect, useState, useRef, useMemo, memo, createRef, forwardRef } from 'react';
|
|
|
|
|
import { Image, Spin, Dropdown } from 'antd';
|
|
|
|
|
import { Image, Spin, Dropdown, Button } from 'antd';
|
|
|
|
|
import { DownOutlined } from '@ant-design/icons';
|
|
|
|
|
import { MessageBox } from 'react-chat-elements';
|
|
|
|
|
import useConversationStore from '@/stores/ConversationStore';
|
|
|
|
@ -17,7 +17,7 @@ const Messages = () => {
|
|
|
|
|
const scrollToMessage = (id, index) => {
|
|
|
|
|
const _i = index || activeMessages.findIndex((msg) => msg.id === id);
|
|
|
|
|
if (_i >= 0) {
|
|
|
|
|
messageRefs.current[_i].current.scrollIntoView({ behavior: "smooth", block: "start" });
|
|
|
|
|
messageRefs.current[_i].current.scrollIntoView({ behavior: "smooth", block: "center" });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -115,13 +115,15 @@ const Messages = () => {
|
|
|
|
|
}
|
|
|
|
|
: {
|
|
|
|
|
replyButton: ['text'].includes(message.whatsapp_msg_type) ? true : false,
|
|
|
|
|
className: 'whitespace-pre-wrap',
|
|
|
|
|
})}
|
|
|
|
|
/>
|
|
|
|
|
// </Dropdown>
|
|
|
|
|
))}
|
|
|
|
|
|
|
|
|
|
<Image src={previewSrc} preview={{ visible: previewVisible, src: previewSrc, onClose: onPreviewClose }} />
|
|
|
|
|
</Spin>
|
|
|
|
|
|
|
|
|
|
<Image src={null} preview={{ visible: previewVisible, src: previewSrc, onClose: onPreviewClose }} />
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|