dify/web/app/components/workflow/plugin-dependency/index.tsx

25 lines
583 B
TypeScript
Raw Normal View History

2024-12-10 14:11:34 +08:00
import { useCallback } from 'react'
2024-11-13 15:48:06 +08:00
import { useStore } from './store'
2024-12-10 14:11:34 +08:00
import InstallBundle from '@/app/components/plugins/install-plugin/install-bundle'
2024-11-13 15:48:06 +08:00
const PluginDependency = () => {
const dependencies = useStore(s => s.dependencies)
2024-12-10 14:11:34 +08:00
const handleCancelInstallBundle = useCallback(() => {
const { setDependencies } = useStore.getState()
setDependencies([])
}, [])
2024-11-15 14:54:01 +08:00
2024-11-13 15:48:06 +08:00
if (!dependencies.length)
return null
return (
2024-12-10 14:11:34 +08:00
<InstallBundle
fromDSLPayload={dependencies}
onClose={handleCancelInstallBundle}
/>
2024-11-13 15:48:06 +08:00
)
}
export default PluginDependency