headerCell.tsx 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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/views/replays/replayTable';
  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,
  36. link: <ExternalLink href="https://docs.sentry.io/platforms/javascript/" />,
  37. }
  38. )}
  39. />
  40. );
  41. case ReplayColumn.COUNT_DEAD_CLICKS_NO_HEADER:
  42. return <SortableHeader label="" />;
  43. case ReplayColumn.COUNT_ERRORS:
  44. return <SortableHeader sort={sort} fieldName="count_errors" label={t('Errors')} />;
  45. case ReplayColumn.COUNT_RAGE_CLICKS:
  46. return (
  47. <SortableHeader
  48. sort={sort}
  49. fieldName="count_rage_clicks"
  50. label={t('Rage clicks')}
  51. tooltip={tct(
  52. '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.]',
  53. {
  54. minSDK: MIN_DEAD_RAGE_CLICK_SDK,
  55. link: <ExternalLink href="https://docs.sentry.io/platforms/javascript/" />,
  56. }
  57. )}
  58. />
  59. );
  60. case ReplayColumn.COUNT_RAGE_CLICKS_NO_HEADER:
  61. return <SortableHeader label="" />;
  62. case ReplayColumn.DURATION:
  63. return <SortableHeader sort={sort} fieldName="duration" label={t('Duration')} />;
  64. case ReplayColumn.OS:
  65. return <SortableHeader sort={sort} fieldName="os.name" label={t('OS')} />;
  66. case ReplayColumn.REPLAY:
  67. return <SortableHeader sort={sort} fieldName="started_at" label={t('Replay')} />;
  68. case ReplayColumn.MOST_ERRONEOUS_REPLAYS:
  69. return <SortableHeader label={t('Most erroneous replays')} />;
  70. case ReplayColumn.MOST_RAGE_CLICKS:
  71. return (
  72. <SortableHeader
  73. label={t('Most rage clicks')}
  74. tooltip={tct(
  75. '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.]',
  76. {
  77. minSDK: MIN_DEAD_RAGE_CLICK_SDK,
  78. link: <ExternalLink href="https://docs.sentry.io/platforms/javascript/" />,
  79. }
  80. )}
  81. />
  82. );
  83. case ReplayColumn.MOST_DEAD_CLICKS:
  84. return (
  85. <SortableHeader
  86. label={t('Most dead clicks')}
  87. tooltip={tct(
  88. '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.]',
  89. {
  90. minSDK: MIN_DEAD_RAGE_CLICK_SDK,
  91. link: <ExternalLink href="https://docs.sentry.io/platforms/javascript/" />,
  92. }
  93. )}
  94. />
  95. );
  96. case ReplayColumn.SLOWEST_TRANSACTION:
  97. return (
  98. <SortableHeader
  99. label={t('Slowest Transaction')}
  100. tooltip={t(
  101. 'Slowest single instance of this transaction captured by this session.'
  102. )}
  103. />
  104. );
  105. default:
  106. return null;
  107. }
  108. }
  109. export default HeaderCell;