tachybase_todo/packages/client/src/workflow/WorkflowRouteProvider.tsx
2022-03-27 16:15:58 +08:00

15 lines
467 B
TypeScript

import React, { useContext } from 'react';
import { RouteSwitchContext } from '../route-switch';
export const WorkflowRouteProvider = (props) => {
const { routes, ...others } = useContext(RouteSwitchContext);
routes[1].routes.unshift(
{
type: 'route',
path: '/admin/workflows/:id',
component: 'WorkflowPage',
},
);
return <RouteSwitchContext.Provider value={{ ...others, routes }}>{props.children}</RouteSwitchContext.Provider>;
};