sharedGroupHeader.tsx 2.3 KB

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