groupEventHeader.tsx 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import styled from '@emotion/styled';
  2. import {DataSection} from 'sentry/components/events/styles';
  3. import GlobalAppStoreConnectUpdateAlert from 'sentry/components/globalAppStoreConnectUpdateAlert';
  4. import {space} from 'sentry/styles/space';
  5. import type {Event, Group, Project} from 'sentry/types';
  6. import {getConfigForIssueType} from 'sentry/utils/issueTypeConfig';
  7. import useOrganization from 'sentry/utils/useOrganization';
  8. import {GroupEventCarousel} from 'sentry/views/issueDetails/groupEventCarousel';
  9. import {TraceTimeline} from 'sentry/views/issueDetails/traceTimeline/traceTimeline';
  10. type GroupEventHeaderProps = {
  11. event: Event;
  12. group: Group;
  13. project: Project;
  14. };
  15. function GroupEventHeader({event, group, project}: GroupEventHeaderProps) {
  16. const organization = useOrganization();
  17. const issueTypeConfig = getConfigForIssueType(group, group.project);
  18. return (
  19. <StyledDataSection>
  20. <GroupEventCarousel group={group} event={event} projectSlug={project.slug} />
  21. {issueTypeConfig.traceTimeline && <TraceTimeline event={event} />}
  22. <StyledGlobalAppStoreConnectUpdateAlert
  23. project={project}
  24. organization={organization}
  25. />
  26. </StyledDataSection>
  27. );
  28. }
  29. const StyledGlobalAppStoreConnectUpdateAlert = styled(GlobalAppStoreConnectUpdateAlert)`
  30. margin: ${space(0.5)} 0;
  31. `;
  32. const StyledDataSection = styled(DataSection)`
  33. padding: ${space(1)} ${space(2)} 0;
  34. @media (min-width: ${p => p.theme.breakpoints.medium}) {
  35. padding: ${space(1.5)} ${space(4)} 0;
  36. }
  37. `;
  38. export default GroupEventHeader;