generalInfo.tsx 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import styled from '@emotion/styled';
  2. import NotAvailable from 'sentry/components/notAvailable';
  3. import {t} from 'sentry/locale';
  4. import space from 'sentry/styles/space';
  5. import {Image} from 'sentry/types/debugImage';
  6. import Processings from '../debugImage/processings';
  7. import {getImageAddress} from '../utils';
  8. type Props = {
  9. image?: Image;
  10. };
  11. function GeneralInfo({image}: Props) {
  12. const {debug_id, debug_file, code_id, code_file, arch, unwind_status, debug_status} =
  13. image ?? {};
  14. const imageAddress = image ? getImageAddress(image) : undefined;
  15. return (
  16. <Wrapper>
  17. <Label coloredBg>{t('Address Range')}</Label>
  18. <Value coloredBg>{imageAddress ?? <NotAvailable />}</Value>
  19. <Label>{t('Debug ID')}</Label>
  20. <Value>{debug_id ?? <NotAvailable />}</Value>
  21. <Label coloredBg>{t('Debug File')}</Label>
  22. <Value coloredBg>{debug_file ?? <NotAvailable />}</Value>
  23. <Label>{t('Code ID')}</Label>
  24. <Value>{code_id ?? <NotAvailable />}</Value>
  25. <Label coloredBg>{t('Code File')}</Label>
  26. <Value coloredBg>{code_file ?? <NotAvailable />}</Value>
  27. <Label>{t('Architecture')}</Label>
  28. <Value>{arch ?? <NotAvailable />}</Value>
  29. <Label coloredBg>{t('Processing')}</Label>
  30. <Value coloredBg>
  31. {unwind_status || debug_status ? (
  32. <Processings unwind_status={unwind_status} debug_status={debug_status} />
  33. ) : (
  34. <NotAvailable />
  35. )}
  36. </Value>
  37. </Wrapper>
  38. );
  39. }
  40. export default GeneralInfo;
  41. const Wrapper = styled('div')`
  42. display: grid;
  43. grid-template-columns: max-content 1fr;
  44. `;
  45. const Label = styled('div')<{coloredBg?: boolean}>`
  46. color: ${p => p.theme.textColor};
  47. padding: ${space(1)} ${space(1.5)} ${space(1)} ${space(1)};
  48. ${p => p.coloredBg && `background-color: ${p.theme.backgroundSecondary};`}
  49. `;
  50. const Value = styled(Label)`
  51. white-space: pre-wrap;
  52. word-break: break-all;
  53. color: ${p => p.theme.subText};
  54. padding: ${space(1)};
  55. font-family: ${p => p.theme.text.familyMono};
  56. ${p => p.coloredBg && `background-color: ${p.theme.backgroundSecondary};`}
  57. `;