|
|
|
|
@ -8,16 +8,19 @@ import useConversationStore from '@/stores/ConversationStore';
|
|
|
|
|
import { useShallow } from 'zustand/react/shallow';
|
|
|
|
|
import useStyleStore from '@/stores/StyleStore';
|
|
|
|
|
import { isEmpty } from '@/utils/commons';
|
|
|
|
|
import { DEFAULT_CHANNEL } from '@/config';
|
|
|
|
|
|
|
|
|
|
const DEFAULT_CHANNEL = 'waba';
|
|
|
|
|
const Wabas = [
|
|
|
|
|
{ key: 'Global Highlights', label: 'Global Highlights' },
|
|
|
|
|
{ key: 'Global Highlights-Multi', label: 'Global Highlights-Multi' },
|
|
|
|
|
];
|
|
|
|
|
const Wabas_mapped = Wabas.reduce((acc, cur) => ({...acc, [cur.key]: cur}), {});
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @ignore
|
|
|
|
|
* 不在此处配置, 在个人档案页面配置
|
|
|
|
|
*/
|
|
|
|
|
const WABASwitcher = ({ onSelect, }) => {
|
|
|
|
|
const [pickV, setPickV] = useState({}); // todo: 全局管理? 后端管理?
|
|
|
|
|
const [pickV, setPickV] = useState({}); // review: 全局管理? 后端管理?
|
|
|
|
|
return (
|
|
|
|
|
<Dropdown
|
|
|
|
|
// trigger={['contextMenu', 'hover']}
|
|
|
|
|
@ -41,6 +44,7 @@ const WABASwitcher = ({ onSelect, }) => {
|
|
|
|
|
|
|
|
|
|
const ReplyWrapper = () => {
|
|
|
|
|
const [mobile] = useStyleStore(state => [state.mobile]);
|
|
|
|
|
|
|
|
|
|
const [activeChannel, setActiveChannel] = useState(DEFAULT_CHANNEL);
|
|
|
|
|
const onChannelTabsChange = (activeKey) => {
|
|
|
|
|
setActiveChannel(activeKey);
|
|
|
|
|
@ -68,7 +72,7 @@ const ReplyWrapper = () => {
|
|
|
|
|
|
|
|
|
|
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: 'waba', label: mobile ? '' : 'WA商业号', icon: <WABIcon />, children: <InputComposer channel={'waba'} /> },
|
|
|
|
|
{ key: 'email', label: mobile ? '' : 'Email', icon: <MailOutlined className='text-indigo-500' />, children: <EmailSwitcher /> },
|
|
|
|
|
// { key: 'whatsapp', label: mobile ? '' : 'WhatsApp', icon: <WhatsAppOutlined className='text-whatsapp' />, children: <InputComposer channel={'whatsapp'} /> },
|
|
|
|
|
{ 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> },
|
|
|
|
|
|