projectReleaseDetails.tsx 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. import styled from '@emotion/styled';
  2. import Count from 'sentry/components/count';
  3. import DateTime from 'sentry/components/dateTime';
  4. import {KeyValueTable, KeyValueTableRow} from 'sentry/components/keyValueTable';
  5. import Link from 'sentry/components/links/link';
  6. import * as SidebarSection from 'sentry/components/sidebarSection';
  7. import TextOverflow from 'sentry/components/textOverflow';
  8. import TimeSince from 'sentry/components/timeSince';
  9. import Version from 'sentry/components/version';
  10. import {t, tn} from 'sentry/locale';
  11. import {ReleaseMeta, ReleaseWithHealth} from 'sentry/types';
  12. type Props = {
  13. orgSlug: string;
  14. projectSlug: string;
  15. release: ReleaseWithHealth;
  16. releaseMeta: ReleaseMeta;
  17. };
  18. const ProjectReleaseDetails = ({release, releaseMeta, orgSlug, projectSlug}: Props) => {
  19. const {version, versionInfo, dateCreated, firstEvent, lastEvent} = release;
  20. return (
  21. <SidebarSection.Wrap>
  22. <SidebarSection.Title>{t('Project Release Details')}</SidebarSection.Title>
  23. <SidebarSection.Content>
  24. <KeyValueTable>
  25. <KeyValueTableRow
  26. keyName={t('Created')}
  27. value={<DateTime date={dateCreated} seconds={false} />}
  28. />
  29. <KeyValueTableRow
  30. keyName={t('Version')}
  31. value={<Version version={version} anchor={false} />}
  32. />
  33. <KeyValueTableRow
  34. keyName={t('Package')}
  35. value={
  36. <StyledTextOverflow ellipsisDirection="left">
  37. {versionInfo.package ?? '\u2014'}
  38. </StyledTextOverflow>
  39. }
  40. />
  41. <KeyValueTableRow
  42. keyName={t('First Event')}
  43. value={firstEvent ? <TimeSince date={firstEvent} /> : '\u2014'}
  44. />
  45. <KeyValueTableRow
  46. keyName={t('Last Event')}
  47. value={lastEvent ? <TimeSince date={lastEvent} /> : '\u2014'}
  48. />
  49. <KeyValueTableRow
  50. keyName={t('Source Maps')}
  51. value={
  52. <Link
  53. to={`/settings/${orgSlug}/projects/${projectSlug}/source-maps/${encodeURIComponent(
  54. version
  55. )}/`}
  56. >
  57. <Count value={releaseMeta.releaseFileCount} />{' '}
  58. {tn('artifact', 'artifacts', releaseMeta.releaseFileCount)}
  59. </Link>
  60. }
  61. />
  62. </KeyValueTable>
  63. </SidebarSection.Content>
  64. </SidebarSection.Wrap>
  65. );
  66. };
  67. const StyledTextOverflow = styled(TextOverflow)`
  68. line-height: inherit;
  69. text-align: right;
  70. `;
  71. export default ProjectReleaseDetails;