mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-24 10:40:07 +08:00
refactor(agents): remove unused useRemoveAgent hook and use deleteAgent from useAgents
This commit is contained in:
parent
5850e5da66
commit
eaa5ec5545
@ -1,12 +0,0 @@
|
||||
// import { useSWRConfig } from 'swr'
|
||||
|
||||
export const useRemoveAgent = () => {
|
||||
// const { mutate } = useSWRConfig()
|
||||
return {
|
||||
removeAgent: () => {
|
||||
// not implemented
|
||||
window.toast.info('Not implemented')
|
||||
},
|
||||
status: {}
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,6 @@
|
||||
import { Button } from '@heroui/react'
|
||||
import { AgentModal } from '@renderer/components/Popups/AgentModal'
|
||||
import { useAgents } from '@renderer/hooks/agents/useAgents'
|
||||
import { useRemoveAgent } from '@renderer/hooks/agents/useRemoveAgent'
|
||||
import { useRuntime } from '@renderer/hooks/useRuntime'
|
||||
import { useAppDispatch } from '@renderer/store'
|
||||
import { setActiveAgentId as setActiveAgentIdAction } from '@renderer/store/runtime'
|
||||
@ -14,8 +13,7 @@ import AgentItem from './components/AgentItem'
|
||||
interface AssistantsTabProps {}
|
||||
|
||||
export const AgentsTab: FC<AssistantsTabProps> = () => {
|
||||
const { agents } = useAgents()
|
||||
const { removeAgent } = useRemoveAgent()
|
||||
const { agents, deleteAgent } = useAgents()
|
||||
const { t } = useTranslation()
|
||||
const { chat } = useRuntime()
|
||||
const { activeAgentId } = chat
|
||||
@ -35,7 +33,7 @@ export const AgentsTab: FC<AssistantsTabProps> = () => {
|
||||
key={agent.id}
|
||||
agent={agent}
|
||||
isActive={agent.id === activeAgentId}
|
||||
onDelete={removeAgent}
|
||||
onDelete={() => deleteAgent(agent.id)}
|
||||
onPress={() => setActiveAgentId(agent.id)}
|
||||
/>
|
||||
))}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user