Skip to content
Snippets Groups Projects

Feature/nat 569 add opa to gui2

Merged Mohammad Torkashvand requested to merge feature/NAT-569-add-opa-to-gui2 into develop
All threads resolved!
Files
2
import React, { createContext, useContext, ReactNode } from 'react';
// Define the shape of the GsoConfig
interface GsoConfig {
opaPublicBundleUrl: string;
oidcClientId: string;
}
// Create the default values for the context
const defaultGsoConfig: GsoConfig = {
opaPublicBundleUrl: '',
oidcClientId: '',
};
// Create the context
const GsoConfigContext = createContext<GsoConfig>(defaultGsoConfig);
// Define the provider's props, including children
interface GsoConfigProviderProps {
initialOrchestratorConfig: GsoConfig;
children: ReactNode;
}
// Create a provider component
export const GsoConfigProvider: React.FC<GsoConfigProviderProps> = ({
initialOrchestratorConfig,
children,
@@ -33,7 +28,6 @@ export const GsoConfigProvider: React.FC<GsoConfigProviderProps> = ({
);
};
// Create a custom hook for using the context
export const useGsoConfig = () => {
return useContext(GsoConfigContext);
};
Loading