grafana/public/app/core/components/WithFeatureToggle.tsx
2019-03-19 13:57:24 +01:00

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;
};