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

14 lines
265 B
TypeScript
Raw Normal View History

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