sharedGroupHeader.tsx 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. import styled from '@emotion/styled';
  2. import EventMessage from 'sentry/components/events/eventMessage';
  3. import ProjectBadge from 'sentry/components/idBadge/projectBadge';
  4. import ShortId from 'sentry/components/shortId';
  5. import space from 'sentry/styles/space';
  6. import {Group} from 'sentry/types';
  7. import UnhandledTag, {
  8. TagAndMessageWrapper,
  9. } from '../organizationGroupDetails/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. <StyledShortId
  19. shortId={group.shortId}
  20. avatar={<ProjectBadge project={group.project} avatarSize={20} hideName />}
  21. />
  22. </TitleWrap>
  23. <TagAndMessageWrapper>
  24. {group.isUnhandled && <UnhandledTag />}
  25. <EventMessage message={group.culprit} />
  26. </TagAndMessageWrapper>
  27. </Details>
  28. </Wrapper>
  29. );
  30. export default SharedGroupHeader;
  31. const Wrapper = styled('div')`
  32. padding: ${space(3)} ${space(4)} ${space(3)} ${space(4)};
  33. border-bottom: 1px solid ${p => p.theme.border};
  34. position: relative;
  35. `;
  36. const Details = styled('div')`
  37. max-width: 960px;
  38. margin: 0 auto;
  39. `;
  40. const TitleWrap = styled('div')`
  41. display: flex;
  42. justify-content: space-between;
  43. align-items: center;
  44. margin-bottom: ${space(1)};
  45. `;
  46. const StyledShortId = styled(ShortId)`
  47. flex-shrink: 0;
  48. `;
  49. const Title = styled('h3')`
  50. color: ${p => p.theme.headingColor};
  51. font-size: ${p => p.theme.fontSizeExtraLarge};
  52. line-height: ${p => p.theme.text.lineHeightHeading};
  53. margin-right: ${space(2)};
  54. margin-bottom: 0;
  55. ${p => p.theme.overflowEllipsis};
  56. @media (min-width: ${props => props.theme.breakpoints.small}) {
  57. font-size: ${p => p.theme.headerFontSize};
  58. }
  59. `;