sharedGroupHeader.tsx 2.3 KB

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