@lobehub/chat 1.141.7 → 1.141.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -0
- package/changelog/v1.json +9 -0
- package/docs/usage/features/{group-chat.mdx → agent-team.mdx} +14 -14
- package/docs/usage/features/agent-team.zh-CN.mdx +52 -0
- package/locales/ar/chat.json +17 -17
- package/locales/ar/setting.json +15 -19
- package/locales/ar/welcome.json +1 -1
- package/locales/bg-BG/chat.json +17 -17
- package/locales/bg-BG/setting.json +15 -19
- package/locales/de-DE/chat.json +17 -17
- package/locales/de-DE/setting.json +15 -19
- package/locales/de-DE/welcome.json +1 -1
- package/locales/en-US/chat.json +17 -17
- package/locales/en-US/setting.json +15 -19
- package/locales/en-US/welcome.json +1 -1
- package/locales/es-ES/chat.json +17 -17
- package/locales/es-ES/setting.json +15 -19
- package/locales/es-ES/welcome.json +1 -1
- package/locales/fa-IR/chat.json +17 -17
- package/locales/fa-IR/setting.json +15 -19
- package/locales/fa-IR/welcome.json +1 -1
- package/locales/fr-FR/chat.json +16 -16
- package/locales/fr-FR/setting.json +15 -19
- package/locales/fr-FR/welcome.json +1 -1
- package/locales/it-IT/chat.json +17 -17
- package/locales/it-IT/setting.json +15 -19
- package/locales/it-IT/welcome.json +1 -1
- package/locales/ja-JP/chat.json +17 -17
- package/locales/ja-JP/setting.json +15 -19
- package/locales/ja-JP/welcome.json +1 -1
- package/locales/ko-KR/chat.json +17 -17
- package/locales/ko-KR/setting.json +15 -19
- package/locales/ko-KR/welcome.json +1 -1
- package/locales/nl-NL/chat.json +17 -17
- package/locales/nl-NL/setting.json +15 -19
- package/locales/nl-NL/welcome.json +1 -1
- package/locales/pl-PL/chat.json +17 -17
- package/locales/pl-PL/setting.json +15 -19
- package/locales/pt-BR/chat.json +17 -17
- package/locales/pt-BR/setting.json +15 -19
- package/locales/pt-BR/welcome.json +1 -1
- package/locales/ru-RU/chat.json +17 -17
- package/locales/ru-RU/setting.json +15 -19
- package/locales/ru-RU/welcome.json +1 -1
- package/locales/tr-TR/chat.json +17 -17
- package/locales/tr-TR/setting.json +15 -19
- package/locales/vi-VN/chat.json +15 -15
- package/locales/vi-VN/setting.json +15 -19
- package/locales/zh-CN/chat.json +17 -17
- package/locales/zh-CN/setting.json +15 -19
- package/locales/zh-CN/welcome.json +1 -1
- package/locales/zh-TW/chat.json +17 -17
- package/locales/zh-TW/setting.json +15 -19
- package/locales/zh-TW/welcome.json +1 -1
- package/package.json +1 -1
- package/packages/const/src/settings/systemAgent.ts +0 -1
- package/packages/types/src/user/settings/systemAgent.ts +0 -1
- package/src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatList/ChatItem/OrchestratorThinking.tsx +2 -3
- package/src/app/[variants]/(main)/chat/(workspace)/@conversation/features/ChatList/ChatItem/index.tsx +2 -2
- package/src/app/[variants]/(main)/chat/(workspace)/@topic/features/GroupConfig/GroupMember.tsx +34 -2
- package/src/app/[variants]/(main)/chat/(workspace)/_layout/Desktop/ChatHeader/Main.tsx +1 -1
- package/src/app/[variants]/(main)/chat/(workspace)/features/{GroupChatSettings → AgentTeamSettings}/index.tsx +4 -5
- package/src/app/[variants]/(main)/chat/(workspace)/features/SettingButton.tsx +2 -2
- package/src/app/[variants]/(main)/chat/@session/_layout/Desktop/SessionHeader.tsx +2 -0
- package/src/app/[variants]/(main)/chat/@session/features/SessionListContent/CollapseGroup/Actions.tsx +18 -1
- package/src/components/ChatGroupWizard/ChatGroupWizard.tsx +33 -5
- package/src/components/MemberSelectionModal/MemberSelectionModal.tsx +170 -26
- package/src/features/Conversation/Messages/Assistant/Actions/index.tsx +7 -2
- package/src/features/Conversation/Messages/User/Actions.tsx +8 -2
- package/src/features/GroupChatSettings/{ChatGroupSettings.tsx → AgentTeamChatSettings.tsx} +6 -5
- package/src/features/GroupChatSettings/{GroupMembers.tsx → AgentTeamMembersSettings.tsx} +64 -19
- package/src/features/GroupChatSettings/{ChatGroupMeta.tsx → AgentTeamMetaSettings.tsx} +2 -2
- package/src/features/GroupChatSettings/AgentTeamSettings.tsx +54 -0
- package/src/features/GroupChatSettings/index.ts +4 -5
- package/src/locales/default/chat.ts +17 -17
- package/src/locales/default/setting.ts +15 -19
- package/src/locales/default/welcome.ts +1 -1
- package/src/store/chat/slices/aiChat/actions/generateAIGroupChat.ts +2 -1
- package/src/store/chatGroup/action.ts +36 -1
- package/src/store/user/slices/settings/selectors/__snapshots__/settings.test.ts.snap +0 -4
- package/src/store/user/slices/settings/selectors/systemAgent.ts +0 -2
- package/docs/usage/features/group-chat.zh-CN.mdx +0 -52
- package/src/features/GroupChatSettings/GroupSettings.tsx +0 -30
- package/src/features/GroupChatSettings/GroupSettingsContent.tsx +0 -24
|
@@ -22,13 +22,13 @@ export default {
|
|
|
22
22
|
},
|
|
23
23
|
clearCurrentMessages: '清空当前会话消息',
|
|
24
24
|
confirmClearCurrentMessages: '即将清空当前会话消息,清空后将无法找回,请确认你的操作',
|
|
25
|
-
confirmRemoveChatGroupItemAlert: '
|
|
25
|
+
confirmRemoveChatGroupItemAlert: '即将删除该 Agent 团队,团队成员不受影响,请确认你的操作',
|
|
26
26
|
confirmRemoveGroupItemAlert: '即将删除该分组,删除后该分组的助手将移动到默认列表,请确认你的操作',
|
|
27
|
-
confirmRemoveGroupSuccess: '
|
|
27
|
+
confirmRemoveGroupSuccess: 'Agent 团队删除成功',
|
|
28
28
|
confirmRemoveSessionItemAlert: '即将删除该助手,删除后该将无法找回,请确认你的操作',
|
|
29
29
|
confirmRemoveSessionSuccess: '助手删除成功',
|
|
30
30
|
defaultAgent: '自定义助手',
|
|
31
|
-
defaultGroupChat: '
|
|
31
|
+
defaultGroupChat: 'Agent 团队',
|
|
32
32
|
defaultList: '默认列表',
|
|
33
33
|
defaultSession: '自定义助手',
|
|
34
34
|
dm: {
|
|
@@ -78,7 +78,7 @@ export default {
|
|
|
78
78
|
removeMember: '移除成员',
|
|
79
79
|
title: '群组',
|
|
80
80
|
},
|
|
81
|
-
groupDescription: '
|
|
81
|
+
groupDescription: '团队描述',
|
|
82
82
|
groupSidebar: {
|
|
83
83
|
members: {
|
|
84
84
|
addMember: '添加成员',
|
|
@@ -98,13 +98,13 @@ export default {
|
|
|
98
98
|
|
|
99
99
|
groupWizard: {
|
|
100
100
|
chooseMembers: '选择现有助手...',
|
|
101
|
-
createGroup: '
|
|
102
|
-
existingMembers: '
|
|
101
|
+
createGroup: '创建团队',
|
|
102
|
+
existingMembers: '已有 Agent',
|
|
103
103
|
groupMembers: '这些助手也将被添加到您的列表中',
|
|
104
104
|
host: {
|
|
105
|
-
description: '
|
|
106
|
-
title: '
|
|
107
|
-
tooltip: '
|
|
105
|
+
description: '使团队自主运行',
|
|
106
|
+
title: '启用主持人',
|
|
107
|
+
tooltip: '如果禁用团队主持人,您需要手动@提及成员才能让他们回复',
|
|
108
108
|
},
|
|
109
109
|
memberCount: '{{count}} 个成员',
|
|
110
110
|
noMatchingTemplates: '没有匹配的模板',
|
|
@@ -112,7 +112,7 @@ export default {
|
|
|
112
112
|
noTemplateMembers: '模板中没有成员',
|
|
113
113
|
noTemplates: '没有可用的模板',
|
|
114
114
|
searchTemplates: '搜索模板...',
|
|
115
|
-
title: '
|
|
115
|
+
title: '创建 Agent 团队',
|
|
116
116
|
useTemplate: '使用模板',
|
|
117
117
|
},
|
|
118
118
|
|
|
@@ -174,11 +174,11 @@ export default {
|
|
|
174
174
|
memberSelection: {
|
|
175
175
|
addMember: '添加成员',
|
|
176
176
|
allMembers: '全体成员',
|
|
177
|
-
createGroup: '
|
|
177
|
+
createGroup: '创建 Agent 团队',
|
|
178
178
|
noAvailableAgents: '没有可邀请的助手',
|
|
179
179
|
noSelectedAgents: '还未选择助手',
|
|
180
180
|
searchAgents: '搜索助手...',
|
|
181
|
-
setInitialMembers: '
|
|
181
|
+
setInitialMembers: '选择团队成员',
|
|
182
182
|
},
|
|
183
183
|
|
|
184
184
|
members: 'Members',
|
|
@@ -253,17 +253,17 @@ export default {
|
|
|
253
253
|
|
|
254
254
|
newAgent: '新建助手',
|
|
255
255
|
|
|
256
|
-
newGroupChat: '
|
|
256
|
+
newGroupChat: '新建 Agent 团队',
|
|
257
257
|
|
|
258
|
-
noAgentsYet: '
|
|
258
|
+
noAgentsYet: '此 Agent 团队还没有成员。点击 + 按钮邀请助手。',
|
|
259
259
|
|
|
260
|
-
noAvailableAgents: '
|
|
260
|
+
noAvailableAgents: '没有可邀请的成员',
|
|
261
261
|
|
|
262
|
-
noMatchingAgents: '
|
|
262
|
+
noMatchingAgents: '没有匹配的成员',
|
|
263
263
|
|
|
264
264
|
noMembersYet: '此群组还没有成员。点击 + 按钮邀请助手。',
|
|
265
265
|
|
|
266
|
-
noSelectedAgents: '
|
|
266
|
+
noSelectedAgents: '还未选择成员',
|
|
267
267
|
|
|
268
268
|
owner: '群主',
|
|
269
269
|
|
|
@@ -43,8 +43,8 @@ export default {
|
|
|
43
43
|
header: {
|
|
44
44
|
desc: '偏好与模型设置',
|
|
45
45
|
global: '全局设置',
|
|
46
|
-
group: '
|
|
47
|
-
groupDesc: '
|
|
46
|
+
group: '团队设置',
|
|
47
|
+
groupDesc: '管理 Agent 团队与聊天偏好',
|
|
48
48
|
session: '会话设置',
|
|
49
49
|
sessionDesc: '角色设定与会话偏好',
|
|
50
50
|
sessionWithName: '会话设置 · {{name}}',
|
|
@@ -310,27 +310,27 @@ export default {
|
|
|
310
310
|
},
|
|
311
311
|
settingGroup: {
|
|
312
312
|
description: {
|
|
313
|
-
placeholder: '
|
|
314
|
-
title: '
|
|
313
|
+
placeholder: '请输入团队描述',
|
|
314
|
+
title: '团队描述',
|
|
315
315
|
},
|
|
316
316
|
name: {
|
|
317
|
-
placeholder: '
|
|
318
|
-
title: '
|
|
317
|
+
placeholder: '请输入团队名称',
|
|
318
|
+
title: '团队名称',
|
|
319
319
|
},
|
|
320
320
|
scene: {
|
|
321
|
-
desc: '
|
|
321
|
+
desc: '选择团队场景',
|
|
322
322
|
options: {
|
|
323
323
|
casual: '休闲',
|
|
324
324
|
productive: '生产力',
|
|
325
325
|
},
|
|
326
|
-
title: '
|
|
326
|
+
title: '团队场景',
|
|
327
327
|
},
|
|
328
|
-
submit: '
|
|
328
|
+
submit: '更新团队',
|
|
329
329
|
systemPrompt: {
|
|
330
330
|
placeholder: '请输入主持人系统提示词',
|
|
331
331
|
title: '主持人系统提示词',
|
|
332
332
|
},
|
|
333
|
-
title: '
|
|
333
|
+
title: 'Agent 团队信息',
|
|
334
334
|
},
|
|
335
335
|
settingGroupChat: {
|
|
336
336
|
allowDM: {
|
|
@@ -338,7 +338,7 @@ export default {
|
|
|
338
338
|
title: '允许助手发送私信',
|
|
339
339
|
},
|
|
340
340
|
enableSupervisor: {
|
|
341
|
-
desc: '
|
|
341
|
+
desc: '启用 Agent 团队主持人功能,主持人将管理团队对话流程',
|
|
342
342
|
title: '启用主持人',
|
|
343
343
|
},
|
|
344
344
|
maxResponseInRow: {
|
|
@@ -351,7 +351,7 @@ export default {
|
|
|
351
351
|
},
|
|
352
352
|
orchestratorTitle: '主持人设置',
|
|
353
353
|
responseOrder: {
|
|
354
|
-
desc: '
|
|
354
|
+
desc: '代理将按照在聊天中设置的顺序进行回复',
|
|
355
355
|
options: {
|
|
356
356
|
natural: '自然',
|
|
357
357
|
sequential: '顺序',
|
|
@@ -360,7 +360,7 @@ export default {
|
|
|
360
360
|
title: '回复顺序',
|
|
361
361
|
},
|
|
362
362
|
responseSpeed: {
|
|
363
|
-
desc: '
|
|
363
|
+
desc: '控制聊天的整体进行速度',
|
|
364
364
|
options: {
|
|
365
365
|
fast: '快速',
|
|
366
366
|
medium: '中等',
|
|
@@ -384,10 +384,11 @@ export default {
|
|
|
384
384
|
settingGroupMembers: {
|
|
385
385
|
addToGroup: '加入群组',
|
|
386
386
|
availableAgents: '可用助手',
|
|
387
|
+
createMember: '创建成员',
|
|
387
388
|
defaultAgent: '自定义助手',
|
|
388
389
|
disableHost: '关闭主持助手',
|
|
389
390
|
edit: '编辑成员',
|
|
390
|
-
empty: '
|
|
391
|
+
empty: '该团队中暂无成员。点击 + 按钮添加成员。',
|
|
391
392
|
enableHost: '启用主持助手',
|
|
392
393
|
groupHost: '群主持',
|
|
393
394
|
groupMembers: '群组成员',
|
|
@@ -631,11 +632,6 @@ export default {
|
|
|
631
632
|
modelDesc: '指定用于 AI 绘画自动命名话题的模型',
|
|
632
633
|
title: 'AI 绘画自动命名话题',
|
|
633
634
|
},
|
|
634
|
-
groupChatSupervisor: {
|
|
635
|
-
label: '群聊监督模型',
|
|
636
|
-
modelDesc: '指定用于监督和管理群聊对话的模型',
|
|
637
|
-
title: '群聊监督管理',
|
|
638
|
-
},
|
|
639
635
|
helpInfo: '当创建新助手时,将以默认助手设置作为预设值。',
|
|
640
636
|
historyCompress: {
|
|
641
637
|
label: '会话历史模型',
|
|
@@ -681,6 +681,7 @@ export const chatAiGroupChat: StateCreator<
|
|
|
681
681
|
msg.role === 'user' ? member.id === 'user' : member.id === msg.agentId,
|
|
682
682
|
);
|
|
683
683
|
const authorName = authorInfo?.title || (msg.role === 'user' ? realUserName : 'Unknown');
|
|
684
|
+
const authorId = msg.role === 'user' ? 'user' : msg.agentId || 'unknown';
|
|
684
685
|
|
|
685
686
|
// Keep user message as-is
|
|
686
687
|
if (msg.role === 'user') {
|
|
@@ -692,7 +693,7 @@ export const chatAiGroupChat: StateCreator<
|
|
|
692
693
|
|
|
693
694
|
return {
|
|
694
695
|
...msg,
|
|
695
|
-
content: `<author_name_do_not_include_in_your_response
|
|
696
|
+
content: `<author_name_do_not_include_in_your_response name="${authorName}" id="${authorId}" />${msg.content}`,
|
|
696
697
|
};
|
|
697
698
|
});
|
|
698
699
|
|
|
@@ -98,14 +98,49 @@ export const chatGroupAction: StateCreator<
|
|
|
98
98
|
return group.id;
|
|
99
99
|
},
|
|
100
100
|
deleteGroup: async (id) => {
|
|
101
|
+
// First, get all group members to identify virtual members
|
|
102
|
+
// Note: ChatGroupAgentItem type is incorrectly defined in schema as agents table type
|
|
103
|
+
// but getGroupAgents actually returns chatGroupsAgents junction table entries
|
|
104
|
+
const groupAgents = (await chatGroupService.getGroupAgents(id)) as unknown as Array<{
|
|
105
|
+
agentId: string;
|
|
106
|
+
chatGroupId: string;
|
|
107
|
+
}>;
|
|
108
|
+
|
|
109
|
+
// Delete the group first (this will cascade delete the chat_groups_agents entries)
|
|
101
110
|
await chatGroupService.deleteGroup(id);
|
|
102
111
|
dispatch({ payload: id, type: 'deleteGroup' });
|
|
103
112
|
|
|
113
|
+
// Now delete virtual members (agents with virtual: true)
|
|
114
|
+
const sessionStore = getSessionStoreState();
|
|
115
|
+
const sessions = sessionStore.sessions || [];
|
|
116
|
+
|
|
117
|
+
// Find and delete all virtual sessions that were members of this group
|
|
118
|
+
const virtualMemberDeletions = groupAgents
|
|
119
|
+
.map((groupAgent) => {
|
|
120
|
+
// groupAgent has agentId property from the junction table
|
|
121
|
+
const session = sessions.find((s) => {
|
|
122
|
+
// Type guard: check if it's an agent session
|
|
123
|
+
if (s.type === 'agent') {
|
|
124
|
+
return s.config?.id === groupAgent.agentId;
|
|
125
|
+
}
|
|
126
|
+
return false;
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
// Only delete if the session exists and has virtual flag set to true
|
|
130
|
+
if (session && session.type === 'agent' && session.config?.virtual) {
|
|
131
|
+
return sessionStore.removeSession(session.id);
|
|
132
|
+
}
|
|
133
|
+
return null;
|
|
134
|
+
})
|
|
135
|
+
.filter(Boolean);
|
|
136
|
+
|
|
137
|
+
// Wait for all virtual member deletions to complete
|
|
138
|
+
await Promise.all(virtualMemberDeletions);
|
|
139
|
+
|
|
104
140
|
await get().loadGroups();
|
|
105
141
|
await getSessionStoreState().refreshSessions();
|
|
106
142
|
|
|
107
143
|
// If the active session is the deleted group, switch to the inbox session
|
|
108
|
-
const sessionStore = getSessionStoreState();
|
|
109
144
|
if (sessionStore.activeId === id) {
|
|
110
145
|
sessionStore.switchSession(INBOX_SESSION_ID);
|
|
111
146
|
}
|
|
@@ -59,10 +59,6 @@ exports[`settingsSelectors > currentSystemAgent > should merge DEFAULT_SYSTEM_AG
|
|
|
59
59
|
"model": "gpt-5-mini",
|
|
60
60
|
"provider": "openai",
|
|
61
61
|
},
|
|
62
|
-
"groupChatSupervisor": {
|
|
63
|
-
"model": "gpt-5-mini",
|
|
64
|
-
"provider": "openai",
|
|
65
|
-
},
|
|
66
62
|
"historyCompress": {
|
|
67
63
|
"model": "gpt-5-mini",
|
|
68
64
|
"provider": "openai",
|
|
@@ -14,12 +14,10 @@ const agentMeta = (s: UserStore) => currentSystemAgent(s).agentMeta;
|
|
|
14
14
|
const queryRewrite = (s: UserStore) => currentSystemAgent(s).queryRewrite;
|
|
15
15
|
const historyCompress = (s: UserStore) => currentSystemAgent(s).historyCompress;
|
|
16
16
|
const generationTopic = (s: UserStore) => currentSystemAgent(s).generationTopic;
|
|
17
|
-
const groupChatSupervisor = (s: UserStore) => currentSystemAgent(s).groupChatSupervisor;
|
|
18
17
|
|
|
19
18
|
export const systemAgentSelectors = {
|
|
20
19
|
agentMeta,
|
|
21
20
|
generationTopic,
|
|
22
|
-
groupChatSupervisor,
|
|
23
21
|
historyCompress,
|
|
24
22
|
queryRewrite,
|
|
25
23
|
thread,
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: 群聊
|
|
3
|
-
description: 让对话变成团队协作。多个 AI 智能体自然配合,为你提供更丰富、更有洞察力的回答。
|
|
4
|
-
tags:
|
|
5
|
-
- 群组对话
|
|
6
|
-
- 多智能体
|
|
7
|
-
- AI 编排
|
|
8
|
-
- 智能体协调
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
# 群聊
|
|
12
|
-
|
|
13
|
-
<Image alt={'群聊'} cover src={'https://github.com/user-attachments/assets/6e5599f6-1e39-4b14-a218-4f5ffa2c306a'} />
|
|
14
|
-
|
|
15
|
-
有时候,一个视角远远不够。群聊功能让多个拥有不同知识和技能的 AI 智能体聚在一起,协作参与你的对话。更丰富的讨论、多元的观点,以及任何单一智能体都无法提供的解决方案。
|
|
16
|
-
|
|
17
|
-
## 亮点
|
|
18
|
-
|
|
19
|
-
- 多个具有专业知识的助手协同工作,各取所长
|
|
20
|
-
- 群聊内置的主持人将确保整个群聊有条不紊的进行
|
|
21
|
-
- 私信功能让助手间无缝协调配合
|
|
22
|
-
- 你将从多个视角获得全面的答案
|
|
23
|
-
- 开箱即用,由你自己的助手组成,或者使用丰富的群聊团队模版
|
|
24
|
-
|
|
25
|
-
## 适用场景
|
|
26
|
-
|
|
27
|
-
**学习研究**:不同的助手通过不同的工具收集不同的资料,汇聚一处并自发讨论。
|
|
28
|
-
|
|
29
|
-
**娱乐**:狼人杀、模拟联合国、海龟汤等多人语聊游戏。
|
|
30
|
-
|
|
31
|
-
**头脑风暴**:多元观点激发更好的想法。
|
|
32
|
-
|
|
33
|
-
**问题解决**:受益于不同专业领域的见解,以及不同的工具和 MCP,群聊允许你拥有完美的 AI 团队。
|
|
34
|
-
|
|
35
|
-
## 快速开始
|
|
36
|
-
|
|
37
|
-
点击「创建群聊」按钮,你可以选择直接从预设的群聊模版创建,或选择你自己的助手组成群聊。
|
|
38
|
-
|
|
39
|
-
你可以在群聊中输入 @ 来提及某个群成员,或者点击它们的头像对其私聊。一切就像是在真实的聊天室中一样。
|
|
40
|
-
|
|
41
|
-
### 中断与继续群聊
|
|
42
|
-
|
|
43
|
-
你可以随时打断主持人的思考,打断后群聊将会「暂停」。你可以随时开启主持人,群聊便会继续。
|
|
44
|
-
|
|
45
|
-
当然,对话也有可能自然地停止。
|
|
46
|
-
|
|
47
|
-
### 高级选项
|
|
48
|
-
|
|
49
|
-
- 群聊速度:自定义群聊的回答速度
|
|
50
|
-
- 自定义主持人:根据特定需要指导主持人的行为
|
|
51
|
-
|
|
52
|
-
群聊改变了你与 AI 的互动方式。不再是获得一个答案,而是参与一场对话 —— 包含不同观点、协作解决问题,以及 AI 智能体协同工作时产生的深刻洞察。
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { Skeleton } from 'antd';
|
|
2
|
-
import { Suspense, memo } from 'react';
|
|
3
|
-
|
|
4
|
-
import { GroupSettingsTabs } from '@/store/global/initialState';
|
|
5
|
-
import { useServerConfigStore } from '@/store/serverConfig';
|
|
6
|
-
|
|
7
|
-
import { GroupChatSettingsProvider } from './GroupChatSettingsProvider';
|
|
8
|
-
import GroupSettingsContent from './GroupSettingsContent';
|
|
9
|
-
import { StoreUpdaterProps } from './StoreUpdater';
|
|
10
|
-
|
|
11
|
-
export interface GroupSettingsProps extends StoreUpdaterProps {
|
|
12
|
-
tab?: GroupSettingsTabs;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const GroupSettings = memo<GroupSettingsProps>(({ tab = GroupSettingsTabs.Settings, ...rest }) => {
|
|
16
|
-
const isMobile = useServerConfigStore((s) => s.isMobile);
|
|
17
|
-
const loadingSkeleton = (
|
|
18
|
-
<Skeleton active paragraph={{ rows: 6 }} style={{ padding: isMobile ? 16 : 0 }} title={false} />
|
|
19
|
-
);
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<GroupChatSettingsProvider {...rest}>
|
|
23
|
-
<Suspense fallback={loadingSkeleton}>
|
|
24
|
-
<GroupSettingsContent loadingSkeleton={loadingSkeleton} tab={tab} />
|
|
25
|
-
</Suspense>
|
|
26
|
-
</GroupChatSettingsProvider>
|
|
27
|
-
);
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
export default GroupSettings;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { ReactNode, memo } from 'react';
|
|
2
|
-
|
|
3
|
-
import { GroupSettingsTabs } from '@/store/global/initialState';
|
|
4
|
-
|
|
5
|
-
import ChatGroupMeta from './ChatGroupMeta';
|
|
6
|
-
import ChatGroupSettings from './ChatGroupSettings';
|
|
7
|
-
import GroupMembers from './GroupMembers';
|
|
8
|
-
|
|
9
|
-
export interface GroupSettingsContentProps {
|
|
10
|
-
loadingSkeleton?: ReactNode;
|
|
11
|
-
tab: GroupSettingsTabs;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const GroupSettingsContent = memo<GroupSettingsContentProps>(({ tab }) => {
|
|
15
|
-
return (
|
|
16
|
-
<>
|
|
17
|
-
{tab === GroupSettingsTabs.Settings && <ChatGroupMeta />}
|
|
18
|
-
{tab === GroupSettingsTabs.Members && <GroupMembers />}
|
|
19
|
-
{tab === GroupSettingsTabs.Chat && <ChatGroupSettings />}
|
|
20
|
-
</>
|
|
21
|
-
);
|
|
22
|
-
});
|
|
23
|
-
|
|
24
|
-
export default GroupSettingsContent;
|