item.tsx 1004 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. import styled from '@emotion/styled';
  2. import * as Sentry from '@sentry/react';
  3. import {t} from 'sentry/locale';
  4. import space from 'sentry/styles/space';
  5. type Props = {
  6. icon: React.ReactElement;
  7. type: 'stack_unwinding' | 'symbolication';
  8. className?: string;
  9. };
  10. function Item({type, icon, className}: Props) {
  11. function getLabel() {
  12. switch (type) {
  13. case 'stack_unwinding':
  14. return t('Stack Unwinding');
  15. case 'symbolication':
  16. return t('Symbolication');
  17. default: {
  18. Sentry.captureException(new Error('Unknown Images Loaded processing item type'));
  19. return null; // This shall not happen
  20. }
  21. }
  22. }
  23. return (
  24. <Wrapper className={className}>
  25. {icon}
  26. {getLabel()}
  27. </Wrapper>
  28. );
  29. }
  30. export default Item;
  31. const Wrapper = styled('div')`
  32. display: grid;
  33. grid-template-columns: max-content 1fr;
  34. grid-column-gap: ${space(0.5)};
  35. align-items: center;
  36. font-size: ${p => p.theme.fontSizeSmall};
  37. white-space: nowrap;
  38. `;