|
|
|
@ -4,7 +4,7 @@ import { LoadingOutlined } from '@ant-design/icons';
|
|
|
|
|
import { MessageBox } from 'react-chat-elements';
|
|
|
|
|
import { MESSAGE_PAGE_SIZE, fetchMessagesHistory } from '@/actions/ConversationActions';
|
|
|
|
|
import useFormStore from '@/stores/FormStore';
|
|
|
|
|
import { isEmpty, stringToColour, groupBy } from '@/utils/commons';
|
|
|
|
|
import { isEmpty, stringToColour, groupBy, isNotEmpty } from '@/utils/commons';
|
|
|
|
|
import { useShallow } from 'zustand/react/shallow';
|
|
|
|
|
|
|
|
|
|
const BIG_PAGE_SIZE = MESSAGE_PAGE_SIZE * 100;
|
|
|
|
@ -134,7 +134,7 @@ const MessagesList = ({ ...props }) => {
|
|
|
|
|
|
|
|
|
|
const RenderText = memo(function renderText({ str, className, template }) {
|
|
|
|
|
let headerObj, footerObj, buttonsArr;
|
|
|
|
|
if (!isEmpty(template)) {
|
|
|
|
|
if (!isEmpty(template) && !isEmpty(template.components)) {
|
|
|
|
|
const componentsObj = groupBy(template.components, (item) => item.type);
|
|
|
|
|
headerObj = componentsObj?.header?.[0];
|
|
|
|
|
footerObj = componentsObj?.footer?.[0];
|
|
|
|
|