headerCell.tsx 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 <SortableHeader sort={sort} fieldName="count_errors" label={t('Errors')} />;
  43. case ReplayColumn.COUNT_RAGE_CLICKS:
  44. return (
  45. <SortableHeader
  46. sort={sort}
  47. fieldName="count_rage_clicks"
  48. label={t('Rage clicks')}
  49. tooltip={tct(
  50. '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.]',
  51. {
  52. minSDK: MIN_DEAD_RAGE_CLICK_SDK.minVersion,
  53. link: <ExternalLink href="https://docs.sentry.io/platforms/javascript/" />,
  54. }
  55. )}
  56. />
  57. );
  58. case ReplayColumn.DURATION:
  59. return <SortableHeader sort={sort} fieldName="duration" label={t('Duration')} />;
  60. case ReplayColumn.OS:
  61. return <SortableHeader sort={sort} fieldName="os.name" label={t('OS')} />;
  62. case ReplayColumn.REPLAY:
  63. return <SortableHeader sort={sort} fieldName="started_at" label={t('Replay')} />;
  64. case ReplayColumn.SLOWEST_TRANSACTION:
  65. return (
  66. <SortableHeader
  67. label={t('Slowest Transaction')}
  68. tooltip={t(
  69. 'Slowest single instance of this transaction captured by this session.'
  70. )}
  71. />
  72. );
  73. default:
  74. return null;
  75. }
  76. }
  77. export default HeaderCell;