@@ -11,8 +11,9 @@ import { ProjectContext } from "../projects/project-context";
11
11
import { getCurrentTeam , TeamsContext } from "../teams/teams-context" ;
12
12
import { UserContext } from "../user-context" ;
13
13
14
- const FeatureFlagContext = createContext < { showUsageBasedPricingUI : boolean } > ( {
14
+ const FeatureFlagContext = createContext < { showUsageBasedPricingUI : boolean ; showWorkspaceClassesUI : boolean } > ( {
15
15
showUsageBasedPricingUI : false ,
16
+ showWorkspaceClassesUI : false ,
16
17
} ) ;
17
18
18
19
const FeatureFlagContextProvider : React . FC = ( { children } ) => {
@@ -22,6 +23,7 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => {
22
23
const location = useLocation ( ) ;
23
24
const team = getCurrentTeam ( location , teams ) ;
24
25
const [ showUsageBasedPricingUI , setShowUsageBasedPricingUI ] = useState < boolean > ( false ) ;
26
+ const [ showWorkspaceClassesUI , setShowWorkspaceClassesUI ] = useState < boolean > ( false ) ;
25
27
26
28
useEffect ( ( ) => {
27
29
if ( ! user ) {
@@ -40,10 +42,19 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => {
40
42
} ,
41
43
) ;
42
44
setShowUsageBasedPricingUI ( isUsageBasedBillingEnabled ) ;
45
+
46
+ const showWorkspaceClasses = await getExperimentsClient ( ) . getValueAsync ( "workspace_classes" , true , {
47
+ user,
48
+ } ) ;
49
+ setShowWorkspaceClassesUI ( showWorkspaceClasses ) ;
43
50
} ) ( ) ;
44
51
} , [ user , teams , team , project ] ) ;
45
52
46
- return < FeatureFlagContext . Provider value = { { showUsageBasedPricingUI } } > { children } </ FeatureFlagContext . Provider > ;
53
+ return (
54
+ < FeatureFlagContext . Provider value = { { showUsageBasedPricingUI, showWorkspaceClassesUI } } >
55
+ { children }
56
+ </ FeatureFlagContext . Provider >
57
+ ) ;
47
58
} ;
48
59
49
60
export { FeatureFlagContext , FeatureFlagContextProvider } ;
0 commit comments