import {cloneElement, Component, Fragment, isValidElement} from 'react'; import Feature from 'app/components/acl/feature'; import {Organization} from 'app/types'; import withOrganization from 'app/utils/withOrganization'; type Props = { organization: Organization; }; class AlertsContainer extends Component { render() { const {children, organization} = this.props; return ( {({hasFeature: hasMetricAlerts}) => ( {children && isValidElement(children) ? cloneElement(children, { organization, hasMetricAlerts, }) : children} )} ); } } export default withOrganization(AlertsContainer);