grafana/public/app/core/components/WithFeatureToggle.tsx

14 lines
282 B
TypeScript
Raw Normal View History

2019-03-08 03:46:52 -06:00
import React, { FunctionComponent } from 'react';
export interface Props {
featureToggle: boolean;
}
export const WithFeatureToggle: FunctionComponent<Props> = ({ featureToggle, children }) => {
if (featureToggle === true) {
return <>{children}</>;
}
return null;
};