index.tsx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import type {RouteComponentProps} from 'react-router';
  2. import * as Layout from 'sentry/components/layouts/thirds';
  3. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  4. import {t} from 'sentry/locale';
  5. import type {Organization} from 'sentry/types';
  6. import useProjects from 'sentry/utils/useProjects';
  7. import withOrganization from 'sentry/utils/withOrganization';
  8. import EventDetailsContent from './content';
  9. type Props = RouteComponentProps<{eventSlug: string}, {}> & {
  10. organization: Organization;
  11. };
  12. function EventDetails(props: Props) {
  13. const {projects} = useProjects();
  14. const getEventSlug = (): string => {
  15. const {eventSlug} = props.params;
  16. return typeof eventSlug === 'string' ? eventSlug.trim() : '';
  17. };
  18. const {organization, location, params} = props;
  19. const documentTitle = t('Performance Details');
  20. const eventSlug = getEventSlug();
  21. const projectSlug = eventSlug.split(':')[0];
  22. return (
  23. <SentryDocumentTitle
  24. title={documentTitle}
  25. orgSlug={organization.slug}
  26. projectSlug={projectSlug}
  27. >
  28. <Layout.Page>
  29. <EventDetailsContent
  30. organization={organization}
  31. location={location}
  32. params={params}
  33. eventSlug={eventSlug}
  34. projects={projects}
  35. />
  36. </Layout.Page>
  37. </SentryDocumentTitle>
  38. );
  39. }
  40. export default withOrganization(EventDetails);