@@ -11,8 +11,9 @@ import { ProjectContext } from "../projects/project-context";
1111import { getCurrentTeam , TeamsContext } from "../teams/teams-context" ;
1212import { UserContext } from "../user-context" ;
1313
14- const FeatureFlagContext = createContext < { showUsageBasedPricingUI : boolean } > ( {
14+ const FeatureFlagContext = createContext < { showUsageBasedPricingUI : boolean ; showWorkspaceClassesUI : boolean } > ( {
1515 showUsageBasedPricingUI : false ,
16+ showWorkspaceClassesUI : false ,
1617} ) ;
1718
1819const FeatureFlagContextProvider : React . FC = ( { children } ) => {
@@ -22,6 +23,7 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => {
2223 const location = useLocation ( ) ;
2324 const team = getCurrentTeam ( location , teams ) ;
2425 const [ showUsageBasedPricingUI , setShowUsageBasedPricingUI ] = useState < boolean > ( false ) ;
26+ const [ showWorkspaceClassesUI , setShowWorkspaceClassesUI ] = useState < boolean > ( false ) ;
2527
2628 useEffect ( ( ) => {
2729 if ( ! user ) {
@@ -40,10 +42,19 @@ const FeatureFlagContextProvider: React.FC = ({ children }) => {
4042 } ,
4143 ) ;
4244 setShowUsageBasedPricingUI ( isUsageBasedBillingEnabled ) ;
45+
46+ const showWorkspaceClasses = await getExperimentsClient ( ) . getValueAsync ( "workspace_classes" , true , {
47+ user,
48+ } ) ;
49+ setShowWorkspaceClassesUI ( showWorkspaceClasses ) ;
4350 } ) ( ) ;
4451 } , [ user , teams , team , project ] ) ;
4552
46- return < FeatureFlagContext . Provider value = { { showUsageBasedPricingUI } } > { children } </ FeatureFlagContext . Provider > ;
53+ return (
54+ < FeatureFlagContext . Provider value = { { showUsageBasedPricingUI, showWorkspaceClassesUI } } >
55+ { children }
56+ </ FeatureFlagContext . Provider >
57+ ) ;
4758} ;
4859
4960export { FeatureFlagContext , FeatureFlagContextProvider } ;
0 commit comments