debugFileFeature.tsx 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import React from 'react';
  2. import styled from '@emotion/styled';
  3. import Tag from 'app/components/tag';
  4. import {IconCheckmark, IconClose} from 'app/icons';
  5. import {t} from 'app/locale';
  6. import space from 'app/styles/space';
  7. const FEATURE_TOOLTIPS = {
  8. symtab: t(
  9. 'Symbol tables are used as a fallback when full debug information is not available'
  10. ),
  11. debug: t(
  12. 'Debug information provides function names and resolves inlined frames during symbolication'
  13. ),
  14. unwind: t(
  15. 'Stack unwinding information improves the quality of stack traces extracted from minidumps'
  16. ),
  17. sources: t(
  18. 'Source code information allows Sentry to display source code context for stack frames'
  19. ),
  20. };
  21. type Props = {
  22. feature: 'symtab' | 'debug' | 'unwind' | 'sources';
  23. available?: boolean;
  24. };
  25. const DebugFileFeature = ({available = true, feature}: Props) => {
  26. const tooltipText = FEATURE_TOOLTIPS[feature];
  27. if (available === true) {
  28. return (
  29. <StyledTag type="success" tooltipText={tooltipText} icon={<IconCheckmark />}>
  30. {feature}
  31. </StyledTag>
  32. );
  33. }
  34. return (
  35. <StyledTag type="error" tooltipText={tooltipText} icon={<IconClose />}>
  36. {feature}
  37. </StyledTag>
  38. );
  39. };
  40. export default DebugFileFeature;
  41. const StyledTag = styled(Tag)`
  42. margin-left: ${space(1)};
  43. `;