|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
import { useEffect } from 'react';
|
|
|
|
|
import { useEffect, useState } from 'react';
|
|
|
|
|
import { Layout } from 'antd';
|
|
|
|
|
import MessagesHeader from '@/views/Conversations/Online/MessagesHeader';
|
|
|
|
|
import MessagesWrapper from '@/views/Conversations/Online/MessagesWrapper';
|
|
|
|
@ -13,14 +13,19 @@ const { Content, Header, Footer } = Layout;
|
|
|
|
|
|
|
|
|
|
function ChatAssign() {
|
|
|
|
|
const navigate = useNavigate();
|
|
|
|
|
const { whatsappid, conversationid } = useParams();
|
|
|
|
|
const { whatsappid, } = useParams();
|
|
|
|
|
|
|
|
|
|
const [currentConversation, setCurrentConversation] = useConversationStore(useShallow((state) => [state.currentConversation, state.setCurrentConversation]));
|
|
|
|
|
|
|
|
|
|
const [conversationid, setConversationid] = useState();
|
|
|
|
|
const [opi, setOpi] = useState({});
|
|
|
|
|
|
|
|
|
|
async function refreshConversationList() {
|
|
|
|
|
const _list = await fetchConversationsSearch({ whatsapp_id: whatsappid });
|
|
|
|
|
if (_list.length > 0) {
|
|
|
|
|
setCurrentConversation(_list[0]);
|
|
|
|
|
setConversationid(String(_list[0].conversationid));
|
|
|
|
|
setOpi({ label: _list[0].opi_name, value: String(_list[0].opi_sn) });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -35,7 +40,7 @@ function ChatAssign() {
|
|
|
|
|
<>
|
|
|
|
|
<Layout className='h-full chatwindow-wrapper mobilechat-wrapper' style={{ maxHeight: 'calc(100vh - 32px)', height: 'calc(100vh - 32px)', minWidth: '360px' }}>
|
|
|
|
|
<Header className=' px-2 ant-layout-sider-light ant-card h-auto flex flex-col justify-between gap-1 '>
|
|
|
|
|
<InputAssign className={'block py-2'} initialValues={{ conversationid, whatsappid }} />
|
|
|
|
|
<InputAssign className={'block py-2'} initialValues={{ conversationid, whatsappid }} {...{ conversationid, opi }} />
|
|
|
|
|
<MessagesHeader />
|
|
|
|
|
</Header>
|
|
|
|
|
<Content className='flex-grow bg-whatsapp-bg relative'>
|
|
|
|
|