mirror of
https://github.com/langgenius/dify.git
synced 2026-06-07 16:32:01 +08:00
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
23 lines
772 B
TypeScript
23 lines
772 B
TypeScript
'use client'
|
|
import * as React from 'react'
|
|
import dynamic from '@/next/dynamic'
|
|
import { useWorkflowGeneratorStore } from './store'
|
|
|
|
// Lazy-load the modal so the bundle of the common layout stays light;
|
|
// the modal is only mounted on demand when cmd+k `/create` fires.
|
|
const WorkflowGeneratorModal = dynamic(() => import('./index'), { ssr: false })
|
|
|
|
/**
|
|
* Global mount point for the workflow generator modal. Place once in the
|
|
* common layout next to ``<GotoAnything />`` — the modal opens whenever the
|
|
* zustand store flips ``isOpen`` to true.
|
|
*/
|
|
const WorkflowGeneratorMount: React.FC = () => {
|
|
const isOpen = useWorkflowGeneratorStore(s => s.isOpen)
|
|
if (!isOpen)
|
|
return null
|
|
return <WorkflowGeneratorModal />
|
|
}
|
|
|
|
export default WorkflowGeneratorMount
|