groupEventHeader.tsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. import styled from '@emotion/styled';
  2. import {DataSection} from 'sentry/components/events/styles';
  3. import {space} from 'sentry/styles/space';
  4. import type {Event} from 'sentry/types/event';
  5. import type {Group} from 'sentry/types/group';
  6. import type {Project} from 'sentry/types/project';
  7. import EventNavigation from 'sentry/views/issueDetails/eventNavigation';
  8. import {GroupEventCarousel} from 'sentry/views/issueDetails/groupEventCarousel';
  9. import {useHasStreamlinedUI} from 'sentry/views/issueDetails/utils';
  10. type GroupEventHeaderProps = {
  11. event: Event;
  12. group: Group;
  13. project: Project;
  14. };
  15. function GroupEventHeader({event, group, project}: GroupEventHeaderProps) {
  16. const hasUpdatedEventNavigation = useHasStreamlinedUI();
  17. return (
  18. <StyledDataSection>
  19. {hasUpdatedEventNavigation ? (
  20. <EventNavigation event={event} group={group} />
  21. ) : (
  22. <GroupEventCarousel group={group} event={event} projectSlug={project.slug} />
  23. )}
  24. </StyledDataSection>
  25. );
  26. }
  27. const StyledDataSection = styled(DataSection)`
  28. padding: ${space(1)} ${space(2)} 0;
  29. @media (min-width: ${p => p.theme.breakpoints.medium}) {
  30. padding: ${space(1.5)} ${space(4)} 0;
  31. }
  32. `;
  33. export default GroupEventHeader;