index.tsx 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import * as Layout from 'sentry/components/layouts/thirds';
  2. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  3. import {t} from 'sentry/locale';
  4. import type {RouteComponentProps} from 'sentry/types/legacyReactRouter';
  5. import type {Organization} from 'sentry/types/organization';
  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);