index.tsx 583 B

123456789101112131415161718192021222324
  1. import { useCallback } from 'react'
  2. import { useStore } from './store'
  3. import InstallBundle from '@/app/components/plugins/install-plugin/install-bundle'
  4. const PluginDependency = () => {
  5. const dependencies = useStore(s => s.dependencies)
  6. const handleCancelInstallBundle = useCallback(() => {
  7. const { setDependencies } = useStore.getState()
  8. setDependencies([])
  9. }, [])
  10. if (!dependencies.length)
  11. return null
  12. return (
  13. <InstallBundle
  14. fromDSLPayload={dependencies}
  15. onClose={handleCancelInstallBundle}
  16. />
  17. )
  18. }
  19. export default PluginDependency