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

14 lines
265 B
TypeScript

import React from 'react';
export interface Props {
featureToggle: boolean;
}
export const WithFeatureToggle = ({ featureToggle, children }: React.PropsWithChildren<Props>) => {
if (featureToggle === true) {
return <>{children}</>;
}
return null;
};