headerCell.tsx 1.5 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 {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 'session':
  12. return <SortableHeader label={t('Session')} />;
  13. case 'projectId':
  14. return <SortableHeader sort={sort} fieldName="projectId" label={t('Project')} />;
  15. case '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 'startedAt':
  25. return <SortableHeader sort={sort} fieldName="startedAt" label={t('Start Time')} />;
  26. case 'duration':
  27. return <SortableHeader sort={sort} fieldName="duration" label={t('Duration')} />;
  28. case 'countErrors':
  29. return <SortableHeader sort={sort} fieldName="countErrors" label={t('Errors')} />;
  30. case 'activity':
  31. return (
  32. <SortableHeader
  33. sort={sort}
  34. fieldName="activity"
  35. label={t('Activity')}
  36. tooltip={t(
  37. 'Activity represents how much user activity happened in a replay. It is determined by the number of errors encountered, duration, and UI events.'
  38. )}
  39. />
  40. );
  41. default:
  42. return null;
  43. }
  44. }
  45. export default HeaderCell;