headerCell.tsx 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 {ReplayColumns} from 'sentry/views/replays/replayTable/types';
  5. type Props = {
  6. column: keyof typeof ReplayColumns;
  7. sort?: Sort;
  8. };
  9. function HeaderCell({column, sort}: Props) {
  10. switch (column) {
  11. case ReplayColumns.session:
  12. return <SortableHeader label={t('Session')} />;
  13. case ReplayColumns.projectId:
  14. return <SortableHeader sort={sort} fieldName="project_id" label={t('Project')} />;
  15. case ReplayColumns.slowestTransaction:
  16. return (
  17. <SortableHeader
  18. label={t('Slowest Transaction')}
  19. tooltip={t(
  20. 'Slowest single instance of this transaction captured by this session.'
  21. )}
  22. />
  23. );
  24. case ReplayColumns.startedAt:
  25. return (
  26. <SortableHeader sort={sort} fieldName="started_at" label={t('Start Time')} />
  27. );
  28. case ReplayColumns.duration:
  29. return <SortableHeader sort={sort} fieldName="duration" label={t('Duration')} />;
  30. case ReplayColumns.countErrors:
  31. return <SortableHeader sort={sort} fieldName="count_errors" label={t('Errors')} />;
  32. case ReplayColumns.activity:
  33. return (
  34. <SortableHeader
  35. sort={sort}
  36. fieldName="activity"
  37. label={t('Activity')}
  38. tooltip={t(
  39. 'Activity represents how much user activity happened in a replay. It is determined by the number of errors encountered, duration, and UI events.'
  40. )}
  41. />
  42. );
  43. default:
  44. return null;
  45. }
  46. }
  47. export default HeaderCell;