index.tsx 664 B

123456789101112131415161718192021222324
  1. import {cloneElement, isValidElement} from 'react';
  2. import {RouteComponentProps} from 'react-router';
  3. import {Organization, Project} from 'sentry/types';
  4. import withOrganization from 'sentry/utils/withOrganization';
  5. type RouteParams = {
  6. orgId: string;
  7. };
  8. type Props = RouteComponentProps<RouteParams, {}> & {
  9. children: React.ReactNode;
  10. organization: Organization;
  11. project: Project;
  12. };
  13. function ProjectSourceMapsContainer(props: Props) {
  14. const {children, organization, project} = props;
  15. return isValidElement(children)
  16. ? cloneElement(children, {organization, project})
  17. : null;
  18. }
  19. export default withOrganization(ProjectSourceMapsContainer);