20 lines
513 B
TypeScript
20 lines
513 B
TypeScript
import * as React from 'react';
|
|
import type { IStep } from '@automatisch/types';
|
|
|
|
export const StepExecutionsContext = React.createContext<IStep[]>([]);
|
|
|
|
type StepExecutionsProviderProps = {
|
|
children: React.ReactNode;
|
|
value: IStep[];
|
|
}
|
|
|
|
export const StepExecutionsProvider = (props: StepExecutionsProviderProps): React.ReactElement => {
|
|
const { children, value } = props;
|
|
return (
|
|
<StepExecutionsContext.Provider
|
|
value={value}
|
|
>
|
|
{children}
|
|
</StepExecutionsContext.Provider>
|
|
);
|
|
}; |