newIssue.tsx 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import {Fragment} from 'react';
  2. import styled from '@emotion/styled';
  3. import EventOrGroupHeader from 'sentry/components/eventOrGroupHeader';
  4. import TimeSince from 'sentry/components/timeSince';
  5. import {IconClock} from 'sentry/icons';
  6. import {t} from 'sentry/locale';
  7. import space from 'sentry/styles/space';
  8. import {Organization} from 'sentry/types';
  9. import {Event} from 'sentry/types/event';
  10. type Props = {
  11. eventCount: number;
  12. organization: Organization;
  13. sampleEvent: Event;
  14. };
  15. function NewIssue({sampleEvent, eventCount, organization}: Props) {
  16. return (
  17. <Fragment>
  18. <EventDetails>
  19. <EventOrGroupHeader
  20. data={sampleEvent}
  21. organization={organization}
  22. grouping
  23. hideIcons
  24. hideLevel
  25. />
  26. <ExtraInfo>
  27. <TimeWrapper>
  28. <StyledIconClock size="11px" />
  29. <TimeSince
  30. date={
  31. sampleEvent.dateCreated
  32. ? sampleEvent.dateCreated
  33. : sampleEvent.dateReceived
  34. }
  35. suffix={t('old')}
  36. />
  37. </TimeWrapper>
  38. </ExtraInfo>
  39. </EventDetails>
  40. <EventCount>{eventCount}</EventCount>
  41. </Fragment>
  42. );
  43. }
  44. export default NewIssue;
  45. const EventDetails = styled('div')`
  46. overflow: hidden;
  47. line-height: 1.1;
  48. `;
  49. const ExtraInfo = styled('div')`
  50. display: grid;
  51. grid-auto-flow: column;
  52. gap: ${space(2)};
  53. justify-content: flex-start;
  54. `;
  55. const TimeWrapper = styled('div')`
  56. display: grid;
  57. gap: ${space(0.5)};
  58. grid-template-columns: max-content 1fr;
  59. align-items: center;
  60. font-size: ${p => p.theme.fontSizeSmall};
  61. `;
  62. const EventCount = styled('div')`
  63. align-items: center;
  64. font-variant-numeric: tabular-nums;
  65. line-height: 1.1;
  66. `;
  67. const StyledIconClock = styled(IconClock)`
  68. color: ${p => p.theme.subText};
  69. `;