activityList.tsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import {Fragment} from 'react';
  2. import styled from '@emotion/styled';
  3. import {DateTime} from 'sentry/components/dateTime';
  4. import {PanelTable} from 'sentry/components/panels/panelTable';
  5. import {t} from 'sentry/locale';
  6. import type {RelayActivity} from 'sentry/types/relay';
  7. type Props = {
  8. activities: Array<RelayActivity>;
  9. };
  10. function ActivityList({activities}: Props) {
  11. return (
  12. <StyledPanelTable headers={[t('Version'), t('First Used'), t('Last Used')]}>
  13. {activities.map(({relayId, version, firstSeen, lastSeen}) => {
  14. return (
  15. <Fragment key={relayId}>
  16. <Version>{version}</Version>
  17. <DateTime date={firstSeen} seconds={false} />
  18. <DateTime date={lastSeen} seconds={false} />
  19. </Fragment>
  20. );
  21. })}
  22. </StyledPanelTable>
  23. );
  24. }
  25. export default ActivityList;
  26. const StyledPanelTable = styled(PanelTable)`
  27. grid-template-columns: repeat(3, 2fr);
  28. @media (min-width: ${p => p.theme.breakpoints.large}) {
  29. grid-template-columns: 2fr repeat(2, 1fr);
  30. }
  31. `;
  32. const Version = styled('div')`
  33. font-variant-numeric: tabular-nums;
  34. `;