index.tsx 1.5 KB

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