mirror of
				https://github.com/grafana/grafana.git
				synced 2025-02-25 18:55:37 -06:00 
			
		
		
		
	
		
			
	
	
		
			14 lines
		
	
	
		
			282 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
		
		
			
		
	
	
			14 lines
		
	
	
		
			282 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| 
								 | 
							
								import React, { FunctionComponent } from 'react';
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								export interface Props {
							 | 
						||
| 
								 | 
							
								  featureToggle: boolean;
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								export const WithFeatureToggle: FunctionComponent<Props> = ({ featureToggle, children }) => {
							 | 
						||
| 
								 | 
							
								  if (featureToggle === true) {
							 | 
						||
| 
								 | 
							
								    return <>{children}</>;
							 | 
						||
| 
								 | 
							
								  }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  return null;
							 | 
						||
| 
								 | 
							
								};
							 |