debugFileFeature.tsx 1.3 KB

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