headerCell.tsx 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. import ExternalLink from 'sentry/components/links/externalLink';
  2. import {t, tct} from 'sentry/locale';
  3. import type {Sort} from 'sentry/utils/discover/fields';
  4. import {MIN_DEAD_RAGE_CLICK_SDK} from 'sentry/utils/replays/sdkVersions';
  5. import SortableHeader from 'sentry/views/replays/replayTable/sortableHeader';
  6. import {ReplayColumn} from 'sentry/views/replays/replayTable/types';
  7. type Props = {
  8. column: ReplayColumn;
  9. sort?: Sort;
  10. };
  11. function HeaderCell({column, sort}: Props) {
  12. switch (column) {
  13. case ReplayColumn.ACTIVITY:
  14. return (
  15. <SortableHeader
  16. sort={sort}
  17. fieldName="activity"
  18. label={t('Activity')}
  19. tooltip={t(
  20. 'Activity represents how much user activity happened in a replay. It is determined by the number of errors encountered, duration, and UI events.'
  21. )}
  22. />
  23. );
  24. case ReplayColumn.BROWSER:
  25. return <SortableHeader sort={sort} fieldName="browser.name" label={t('Browser')} />;
  26. case ReplayColumn.COUNT_DEAD_CLICKS:
  27. return (
  28. <SortableHeader
  29. sort={sort}
  30. fieldName="count_dead_clicks"
  31. label={t('Dead clicks')}
  32. tooltip={tct(
  33. 'A dead click is a user click that does not result in any page activity after 7 seconds. Requires SDK version >= [minSDK]. [link:Learn more.]',
  34. {
  35. minSDK: MIN_DEAD_RAGE_CLICK_SDK.minVersion,
  36. link: <ExternalLink href="https://docs.sentry.io/platforms/javascript/" />,
  37. }
  38. )}
  39. />
  40. );
  41. case ReplayColumn.COUNT_ERRORS:
  42. return (
  43. <SortableHeader
  44. sort={sort}
  45. fieldName="count_errors"
  46. label={t('Errors')}
  47. tooltip={tct(
  48. 'The error count only reflects errors generated within the Replay SDK. [inboundFilters:Inbound Filters] may have prevented those errors from being saved. [perfIssue:Performance] and other [replayIssue:error] types may have been added afterwards.',
  49. {
  50. inboundFilters: (
  51. <ExternalLink href="https://docs.sentry.io/concepts/data-management/filtering/" />
  52. ),
  53. replayIssue: (
  54. <ExternalLink href="https://docs.sentry.io/product/issues/issue-details/replay-issues/" />
  55. ),
  56. perfIssue: (
  57. <ExternalLink href="https://docs.sentry.io/product/issues/issue-details/performance-issues/" />
  58. ),
  59. }
  60. )}
  61. />
  62. );
  63. case ReplayColumn.COUNT_RAGE_CLICKS:
  64. return (
  65. <SortableHeader
  66. sort={sort}
  67. fieldName="count_rage_clicks"
  68. label={t('Rage clicks')}
  69. tooltip={tct(
  70. 'A rage click is 5 or more clicks on a dead element, which exhibits no page activity after 7 seconds. Requires SDK version >= [minSDK]. [link:Learn more.]',
  71. {
  72. minSDK: MIN_DEAD_RAGE_CLICK_SDK.minVersion,
  73. link: <ExternalLink href="https://docs.sentry.io/platforms/javascript/" />,
  74. }
  75. )}
  76. />
  77. );
  78. case ReplayColumn.DURATION:
  79. return <SortableHeader sort={sort} fieldName="duration" label={t('Duration')} />;
  80. case ReplayColumn.OS:
  81. return <SortableHeader sort={sort} fieldName="os.name" label={t('OS')} />;
  82. case ReplayColumn.REPLAY:
  83. return <SortableHeader sort={sort} fieldName="started_at" label={t('Replay')} />;
  84. case ReplayColumn.SLOWEST_TRANSACTION:
  85. return (
  86. <SortableHeader
  87. label={t('Slowest Transaction')}
  88. tooltip={t(
  89. 'Slowest single instance of this transaction captured by this session.'
  90. )}
  91. />
  92. );
  93. default:
  94. return null;
  95. }
  96. }
  97. export default HeaderCell;