headerCell.tsx 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import {t} from 'sentry/locale';
  2. import type {Sort} from 'sentry/utils/discover/fields';
  3. import SortableHeader from 'sentry/views/replays/replayTable/sortableHeader';
  4. import {ReplayColumn} from 'sentry/views/replays/replayTable/types';
  5. type Props = {
  6. column: ReplayColumn;
  7. sort?: Sort;
  8. };
  9. function HeaderCell({column, sort}: Props) {
  10. switch (column) {
  11. case ReplayColumn.ACTIVITY:
  12. return (
  13. <SortableHeader
  14. sort={sort}
  15. fieldName="activity"
  16. label={t('Activity')}
  17. tooltip={t(
  18. 'Activity represents how much user activity happened in a replay. It is determined by the number of errors encountered, duration, and UI events.'
  19. )}
  20. />
  21. );
  22. case ReplayColumn.BROWSER:
  23. return <SortableHeader sort={sort} fieldName="browser.name" label={t('Browser')} />;
  24. case ReplayColumn.COUNT_ERRORS:
  25. return <SortableHeader sort={sort} fieldName="count_errors" label={t('Errors')} />;
  26. case ReplayColumn.DURATION:
  27. return <SortableHeader sort={sort} fieldName="duration" label={t('Duration')} />;
  28. case ReplayColumn.OS:
  29. return <SortableHeader sort={sort} fieldName="os.name" label={t('OS')} />;
  30. case ReplayColumn.REPLAY:
  31. return <SortableHeader sort={sort} fieldName="started_at" label={t('Replay')} />;
  32. case ReplayColumn.SLOWEST_TRANSACTION:
  33. return (
  34. <SortableHeader
  35. label={t('Slowest Transaction')}
  36. tooltip={t(
  37. 'Slowest single instance of this transaction captured by this session.'
  38. )}
  39. />
  40. );
  41. default:
  42. return null;
  43. }
  44. }
  45. export default HeaderCell;