index.tsx 768 B

1234567891011121314151617181920212223242526
  1. import useRouteAnalyticsParams from 'sentry/utils/routeAnalytics/useRouteAnalyticsParams';
  2. import useProjects from 'sentry/utils/useProjects';
  3. import withOrganization from 'sentry/utils/withOrganization';
  4. import ProjectDetail from './projectDetail';
  5. function ProjectDetailContainer(
  6. props: Omit<
  7. React.ComponentProps<typeof ProjectDetail>,
  8. 'projects' | 'loadingProjects' | 'selection'
  9. >
  10. ) {
  11. const {projects} = useProjects();
  12. const project = projects.find(p => p.slug === props.params.projectId);
  13. useRouteAnalyticsParams(
  14. project
  15. ? {
  16. project_id: project.id,
  17. project_platform: project.platform,
  18. }
  19. : {}
  20. );
  21. return <ProjectDetail {...props} />;
  22. }
  23. export default withOrganization(ProjectDetailContainer);