|
|
|
@ -7,6 +7,7 @@ import { WABIcon } from '@/components/Icons';
|
|
|
|
|
import useConversationStore from '@/stores/ConversationStore';
|
|
|
|
|
import { useShallow } from 'zustand/react/shallow';
|
|
|
|
|
import useStyleStore from '@/stores/StyleStore';
|
|
|
|
|
import { isEmpty } from '@/utils/commons';
|
|
|
|
|
|
|
|
|
|
const DEFAULT_CHANNEL = 'waba';
|
|
|
|
|
const Wabas = [
|
|
|
|
@ -45,6 +46,7 @@ const ReplyWrapper = () => {
|
|
|
|
|
setActiveChannel(activeKey);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const [referenceMsg] = useConversationStore((state) => [state.referenceMsg]);
|
|
|
|
|
const activeMessages = useConversationStore(
|
|
|
|
|
useShallow((state) => (state.currentConversation.sn && state.activeConversations[state.currentConversation.sn] ? state.activeConversations[state.currentConversation.sn] : []))
|
|
|
|
|
);
|
|
|
|
@ -56,12 +58,20 @@ const ReplyWrapper = () => {
|
|
|
|
|
return () => {};
|
|
|
|
|
}, [activeMessages]);
|
|
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
|
if (!isEmpty(referenceMsg.msg_source)) {
|
|
|
|
|
setActiveChannel((referenceMsg.msg_source).toLowerCase())
|
|
|
|
|
}
|
|
|
|
|
return () => {}
|
|
|
|
|
}, [referenceMsg.msg_source])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const replyTypes = [
|
|
|
|
|
// { key: 'waba', label: mobile ? '' : (<WABASwitcher />), icon: <WABIcon />, children: <InputComposer channel={'waba'} /> },
|
|
|
|
|
{ key: 'waba', label: mobile ? '' : 'WA商业号-Global Highlights', icon: <WABIcon />, children: <InputComposer channel={'waba'} /> }, // todo: 从配置读取
|
|
|
|
|
{ key: 'email', label: mobile ? '' : 'Email', icon: <MailOutlined className='text-indigo-500' />, children: <EmailComposer /> },
|
|
|
|
|
// { key: 'whatsapp', label: mobile ? '' : 'WhatsApp', icon: <WhatsAppOutlined className='text-whatsapp' />, children: <InputComposer channel={'whatsapp'} /> },
|
|
|
|
|
{ key: 'whatsapp', label: mobile ? '' : 'WhatsApp', icon: <WhatsAppOutlined className='text-whatsapp' />, children: <div className='p-2 py-4 text-center text-whatsapp bg-gray-200 rounded rounded-b-none border-gray-300 border-solid border border-b-0 border-x-0'>敬请期待</div> },
|
|
|
|
|
{ key: 'wa', label: mobile ? '' : 'WhatsApp', icon: <WhatsAppOutlined className='text-whatsapp' />, children: <div className='p-2 py-4 text-center text-whatsapp bg-gray-200 rounded rounded-b-none border-gray-300 border-solid border border-b-0 border-x-0'>敬请期待</div> },
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|