-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
62 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Button, Popconfirm } from 'antd'; | ||
import React from 'react'; | ||
|
||
import { agentListSelectors, useAgentStore } from '@/store/agent'; | ||
|
||
export default () => { | ||
const currentAgent = useAgentStore((s) => agentListSelectors.currentAgentItem(s)); | ||
const [unsubscribe] = useAgentStore((s) => [s.unsubscribe]); | ||
|
||
return ( | ||
<Popconfirm | ||
cancelText="取消" | ||
description={`确定删除角色 ${currentAgent?.meta.name} 以及相关联的会话消息吗?删除后无法恢复, 请谨慎操作!`} | ||
key="delete" | ||
okText="确定" | ||
onConfirm={() => { | ||
if (!currentAgent) return; | ||
unsubscribe(currentAgent.agentId); | ||
}} | ||
title="取消订阅?" | ||
> | ||
<Button danger>删除角色</Button> | ||
</Popconfirm> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters