keyMetrics.tsx 896 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import {Fragment} from 'react';
  2. import styled from '@emotion/styled';
  3. import space from 'sentry/styles/space';
  4. /**
  5. * Very similar to app/components/keyValueTable.tsx
  6. * TODO(replay): move into app/components
  7. */
  8. type Props = {
  9. keyName: React.ReactNode;
  10. value: React.ReactNode;
  11. };
  12. export const KeyMetrics = styled('dl')`
  13. margin: 0; /* Reset default dl styles */
  14. display: grid;
  15. grid-template-rows: auto auto;
  16. grid-auto-columns: 1fr;
  17. grid-auto-flow: column;
  18. gap: ${space(0.5)} ${space(2)};
  19. text-align: right;
  20. `;
  21. export const KeyMetricData = ({keyName, value}: Props) => {
  22. return (
  23. <Fragment>
  24. <Key>{keyName}</Key>
  25. <Value>{value}</Value>
  26. </Fragment>
  27. );
  28. };
  29. const Key = styled('dt')`
  30. color: ${p => p.theme.subText};
  31. font-size: 14px;
  32. font-weight: bold;
  33. `;
  34. const Value = styled('dt')`
  35. color: ${p => p.theme.textColor};
  36. font-weight: normal;
  37. `;