sharedGroupHeader.tsx 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import styled from '@emotion/styled';
  2. import EventMessage from 'sentry/components/events/eventMessage';
  3. import FeatureBadge from 'sentry/components/featureBadge';
  4. import ProjectBadge from 'sentry/components/idBadge/projectBadge';
  5. import ShortId from 'sentry/components/shortId';
  6. import {t} from 'sentry/locale';
  7. import {space} from 'sentry/styles/space';
  8. import {Group, IssueCategory} from 'sentry/types';
  9. import UnhandledTag, {TagAndMessageWrapper} from '../issueDetails/unhandledTag';
  10. type Props = {
  11. group: Group;
  12. };
  13. const SharedGroupHeader = ({group}: Props) => (
  14. <Wrapper>
  15. <Details>
  16. <TitleWrap>
  17. <Title>{group.title}</Title>
  18. <ShortIdWrapper>
  19. <ShortId
  20. shortId={group.shortId}
  21. avatar={<ProjectBadge project={group.project} avatarSize={20} hideName />}
  22. />
  23. {group.issueCategory === IssueCategory.PERFORMANCE && (
  24. <FeatureBadge
  25. type="beta"
  26. title={t(
  27. 'Not all features have been implemented for shared Performance Issues and these issues may be missing context.'
  28. )}
  29. />
  30. )}
  31. </ShortIdWrapper>
  32. </TitleWrap>
  33. <TagAndMessageWrapper>
  34. {group.isUnhandled && <UnhandledTag />}
  35. <EventMessage message={group.culprit} />
  36. </TagAndMessageWrapper>
  37. </Details>
  38. </Wrapper>
  39. );
  40. export default SharedGroupHeader;
  41. const Wrapper = styled('div')`
  42. padding: ${space(3)} ${space(4)} ${space(3)} ${space(4)};
  43. border-bottom: 1px solid ${p => p.theme.border};
  44. position: relative;
  45. `;
  46. const Details = styled('div')`
  47. max-width: 960px;
  48. margin: 0 auto;
  49. `;
  50. const ShortIdWrapper = styled('div')`
  51. display: flex;
  52. `;
  53. const TitleWrap = styled('div')`
  54. display: grid;
  55. grid-template-columns: 1fr max-content;
  56. align-items: center;
  57. margin-bottom: ${space(1)};
  58. `;
  59. const Title = styled('h3')`
  60. color: ${p => p.theme.headingColor};
  61. font-size: ${p => p.theme.fontSizeExtraLarge};
  62. line-height: ${p => p.theme.text.lineHeightHeading};
  63. margin-right: ${space(2)};
  64. margin-bottom: 0;
  65. ${p => p.theme.overflowEllipsis};
  66. @media (min-width: ${props => props.theme.breakpoints.small}) {
  67. font-size: ${p => p.theme.headerFontSize};
  68. }
  69. `;