import {cloneElement, isValidElement} from 'react'; import Feature from 'sentry/components/acl/feature'; import NoProjectMessage from 'sentry/components/noProjectMessage'; import {Organization} from 'sentry/types'; import withOrganization from 'sentry/utils/withOrganization'; type Props = { organization: Organization; children?: React.ReactNode; }; function TeamInsightsContainer({children, organization}: Props) { return ( {children && isValidElement(children) ? cloneElement(children, { organization, }) : (children as React.ReactChild)} ); } export default withOrganization(TeamInsightsContainer);