import React, { useContext } from 'react'; import { Card } from 'antd'; import { PluginManagerContext, RouteSwitchContext, SchemaComponent, SchemaComponentOptions, SettingsCenterProvider } from '@nocobase/client'; import { WorkflowPage } from './WorkflowPage'; import { ExecutionPage } from './ExecutionPage'; import { triggers } from './triggers'; import { instructions } from './nodes'; import { lang } from './locale'; import { workflowSchema } from './schemas/workflows'; import { WorkflowLink } from './WorkflowLink'; import { ExecutionResourceProvider } from './ExecutionResourceProvider'; import { ExecutionLink } from './ExecutionLink'; import OpenDrawer from './components/OpenDrawer'; import { WorkflowTodo } from './nodes/manual/WorkflowTodo'; import { WorkflowTodoBlockInitializer } from './nodes/manual/WorkflowTodoBlockInitializer'; export const WorkflowContext = React.createContext({}); export function useWorkflowContext() { return useContext(WorkflowContext); } function WorkflowPane() { return ( ); }; export const WorkflowProvider = (props) => { const ctx = useContext(PluginManagerContext); const { routes, components, ...others } = useContext(RouteSwitchContext); routes[1].routes.unshift( { type: 'route', path: '/admin/settings/workflow/workflows/:id', component: 'WorkflowPage', }, { type: 'route', path: '/admin/settings/workflow/executions/:id', component: 'ExecutionPage', }, ); return ( {props.children} ); };