import {cloneElement, Fragment, isValidElement} from 'react'; import Access from 'sentry/components/acl/access'; import type {RouteComponentProps} from 'sentry/types/legacyReactRouter'; import type {Organization} from 'sentry/types/organization'; import type {Project} from 'sentry/types/project'; interface Props extends RouteComponentProps<{organizationId: string; projectId: string}, {}> { children: React.ReactNode; organization: Organization; project: Project; } function ProjectAlerts({children, project}: Props) { return ( {({hasAccess}) => ( {isValidElement(children) && cloneElement(children, { canEditRule: hasAccess, })} )} ); } export default ProjectAlerts;