index.tsx 702 B

1234567891011121314151617181920212223242526
  1. import {cloneElement, Fragment, isValidElement} from 'react';
  2. import Feature from 'app/components/acl/feature';
  3. import {Organization} from 'app/types';
  4. import withOrganization from 'app/utils/withOrganization';
  5. type Props = {
  6. organization: Organization;
  7. children?: React.ReactNode;
  8. };
  9. function TeamInsightsContainer({children, organization}: Props) {
  10. return (
  11. <Feature organization={organization} features={['team-insights']}>
  12. <Fragment>
  13. {children && isValidElement(children)
  14. ? cloneElement(children, {
  15. organization,
  16. })
  17. : children}
  18. </Fragment>
  19. </Feature>
  20. );
  21. }
  22. export default withOrganization(TeamInsightsContainer);