diff --git a/lib/context/GraphConfigContext.tsx b/lib/context/GraphConfigContext.tsx deleted file mode 100644 index 3b1c1d4..0000000 --- a/lib/context/GraphConfigContext.tsx +++ /dev/null @@ -1,69 +0,0 @@ -import { GraphConfig, IGraphConfig } from '../config' -import { - createContext, - Dispatch, - ReactNode, - SetStateAction, - useState, -} from 'react' - -const defaultConfig: IGraphConfig = { - valueTypes: { - string: { - name: 'String', - color: '#a1a1a1', - inputType: 'value', - defaultValue: '', - }, - }, - nodeGroups: { - default: { - name: 'Default', - color: '#a1a1a1', - }, - }, - nodes: { - string: { - group: 'default', - name: 'String', - inputs: [ - { - name: 'Value', - id: 'value', - valueType: 'string', - }, - ], - outputs: [ - { - name: 'Value', - id: 'value', - valueType: 'string', - }, - ], - }, - }, -} - -export const GraphConfigContext = createContext<{ - config: GraphConfig - setConfig: Dispatch> -}>({ config: new GraphConfig(defaultConfig), setConfig: (c) => c }) - -type GraphConfigProviderProps = { - children: ReactNode - defaultConfig?: GraphConfig -} - -export function GraphConfigProvider({ - children, - defaultConfig: _defaultConfig, -}: GraphConfigProviderProps) { - const [config, setConfig] = useState( - _defaultConfig ?? new GraphConfig(defaultConfig).validate(), - ) - return ( - - {children} - - ) -} diff --git a/lib/context/GraphContext.tsx b/lib/context/GraphContext.tsx index 905e8c7..f7d4faa 100644 --- a/lib/context/GraphContext.tsx +++ b/lib/context/GraphContext.tsx @@ -10,8 +10,6 @@ type ContextType = ReturnType | null export const GraphContext = createContext(null) -// export const GraphProvider = GraphContext.Provider - type ExtractState = GraphStore export function useGraphStore(