deploys.tsx 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import styled from '@emotion/styled';
  2. import DeployBadge from 'sentry/components/deployBadge';
  3. import * as SidebarSection from 'sentry/components/sidebarSection';
  4. import TextOverflow from 'sentry/components/textOverflow';
  5. import TimeSince from 'sentry/components/timeSince';
  6. import {t} from 'sentry/locale';
  7. import {space} from 'sentry/styles/space';
  8. import {Deploy} from 'sentry/types';
  9. type Props = {
  10. deploys: Deploy[];
  11. orgSlug: string;
  12. projectId: number;
  13. version: string;
  14. };
  15. function Deploys({version, orgSlug, projectId, deploys}: Props) {
  16. return (
  17. <SidebarSection.Wrap>
  18. <SidebarSection.Title>{t('Deploys')}</SidebarSection.Title>
  19. <SidebarSection.Content>
  20. {deploys.map(deploy => (
  21. <Row key={deploy.id}>
  22. <DeployBadge
  23. deploy={deploy}
  24. orgSlug={orgSlug}
  25. version={version}
  26. projectId={projectId}
  27. />
  28. <TextOverflow>
  29. <TimeSince date={deploy.dateFinished} />
  30. </TextOverflow>
  31. </Row>
  32. ))}
  33. </SidebarSection.Content>
  34. </SidebarSection.Wrap>
  35. );
  36. }
  37. const Row = styled('div')`
  38. display: flex;
  39. gap: ${space(1)};
  40. align-items: center;
  41. justify-content: space-between;
  42. margin-bottom: ${space(1)};
  43. font-size: ${p => p.theme.fontSizeMedium};
  44. color: ${p => p.theme.subText};
  45. `;
  46. export default Deploys;