mirror of
https://github.com/langgenius/dify.git
synced 2026-04-27 11:06:46 +08:00
fix: next step tool icon
This commit is contained in:
parent
a264973366
commit
dafdbfa0fd
@ -1,7 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
memo,
|
memo,
|
||||||
useCallback,
|
useCallback,
|
||||||
useMemo,
|
|
||||||
} from 'react'
|
} from 'react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import { intersection } from 'lodash-es'
|
import { intersection } from 'lodash-es'
|
||||||
@ -15,10 +14,9 @@ import {
|
|||||||
useNodesExtraData,
|
useNodesExtraData,
|
||||||
useNodesInteractions,
|
useNodesInteractions,
|
||||||
useNodesReadOnly,
|
useNodesReadOnly,
|
||||||
|
useToolIcon,
|
||||||
} from '@/app/components/workflow/hooks'
|
} from '@/app/components/workflow/hooks'
|
||||||
import Button from '@/app/components/base/button'
|
import Button from '@/app/components/base/button'
|
||||||
import { useStore } from '@/app/components/workflow/store'
|
|
||||||
import { BlockEnum } from '@/app/components/workflow/types'
|
|
||||||
|
|
||||||
type ItemProps = {
|
type ItemProps = {
|
||||||
nodeId: string
|
nodeId: string
|
||||||
@ -36,11 +34,7 @@ const Item = ({
|
|||||||
const { handleNodeChange } = useNodesInteractions()
|
const { handleNodeChange } = useNodesInteractions()
|
||||||
const { nodesReadOnly } = useNodesReadOnly()
|
const { nodesReadOnly } = useNodesReadOnly()
|
||||||
const nodesExtraData = useNodesExtraData()
|
const nodesExtraData = useNodesExtraData()
|
||||||
const toolsets = useStore(s => s.toolsets)
|
const toolIcon = useToolIcon(data)
|
||||||
const toolIcon = useMemo(() => {
|
|
||||||
if (data.type === BlockEnum.Tool)
|
|
||||||
return toolsets.find(toolset => toolset.id === data.provider_id)?.icon
|
|
||||||
}, [data, toolsets])
|
|
||||||
const availablePrevNodes = nodesExtraData[data.type].availablePrevNodes
|
const availablePrevNodes = nodesExtraData[data.type].availablePrevNodes
|
||||||
const availableNextNodes = nodesExtraData[data.type].availableNextNodes
|
const availableNextNodes = nodesExtraData[data.type].availableNextNodes
|
||||||
const handleSelect = useCallback<OnSelectBlock>((type, toolDefaultValue) => {
|
const handleSelect = useCallback<OnSelectBlock>((type, toolDefaultValue) => {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user