deadRageClickList.tsx 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. import styled from '@emotion/styled';
  2. import * as Layout from 'sentry/components/layouts/thirds';
  3. import {DatePageFilter} from 'sentry/components/organizations/datePageFilter';
  4. import {EnvironmentPageFilter} from 'sentry/components/organizations/environmentPageFilter';
  5. import PageFilterBar from 'sentry/components/organizations/pageFilterBar';
  6. import PageFiltersContainer from 'sentry/components/organizations/pageFilters/container';
  7. import {ProjectPageFilter} from 'sentry/components/organizations/projectPageFilter';
  8. import {PageHeadingQuestionTooltip} from 'sentry/components/pageHeadingQuestionTooltip';
  9. import Pagination from 'sentry/components/pagination';
  10. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  11. import {t} from 'sentry/locale';
  12. import {space} from 'sentry/styles/space';
  13. import {browserHistory} from 'sentry/utils/browserHistory';
  14. import useDeadRageSelectors from 'sentry/utils/replays/hooks/useDeadRageSelectors';
  15. import {useLocation} from 'sentry/utils/useLocation';
  16. import useOrganization from 'sentry/utils/useOrganization';
  17. import SelectorTable from 'sentry/views/replays/deadRageClick/selectorTable';
  18. import ReplayTabs from 'sentry/views/replays/tabs';
  19. export default function DeadRageClickList() {
  20. const organization = useOrganization();
  21. const location = useLocation();
  22. const {isLoading, isError, data, pageLinks} = useDeadRageSelectors({
  23. per_page: 50,
  24. sort: '-count_dead_clicks',
  25. cursor: location.query.cursor,
  26. prefix: '',
  27. isWidgetData: false,
  28. });
  29. return (
  30. <SentryDocumentTitle
  31. title={t('Top Selectors with Dead Clicks')}
  32. orgSlug={organization.slug}
  33. >
  34. <Layout.Header>
  35. <Layout.HeaderContent>
  36. <Layout.Title>
  37. {t('Top Selectors with Dead and Rage Clicks')}
  38. <PageHeadingQuestionTooltip
  39. title={t('See the top selectors your users have dead and rage clicked on.')}
  40. docsUrl="https://docs.sentry.io/product/session-replay/replay-page-and-filters/"
  41. />
  42. </Layout.Title>
  43. </Layout.HeaderContent>
  44. <div /> {/* wraps the tabs below the page title */}
  45. <ReplayTabs selected="selectors" />
  46. </Layout.Header>
  47. <PageFiltersContainer>
  48. <Layout.Body>
  49. <Layout.Main fullWidth>
  50. <PageFilterBar condensed>
  51. <ProjectPageFilter resetParamsOnChange={['cursor']} />
  52. <EnvironmentPageFilter resetParamsOnChange={['cursor']} />
  53. <DatePageFilter resetParamsOnChange={['cursor']} />
  54. </PageFilterBar>
  55. <LayoutGap>
  56. <SelectorTable
  57. data={data}
  58. isError={isError}
  59. isLoading={isLoading}
  60. location={location}
  61. clickCountColumns={[
  62. {key: 'count_dead_clicks', name: 'dead clicks'},
  63. {key: 'count_rage_clicks', name: 'rage clicks'},
  64. ]}
  65. clickCountSortable
  66. />
  67. </LayoutGap>
  68. <PaginationNoMargin
  69. pageLinks={pageLinks}
  70. onCursor={(cursor, path, searchQuery) => {
  71. browserHistory.push({
  72. pathname: path,
  73. query: {...searchQuery, cursor},
  74. });
  75. }}
  76. />
  77. </Layout.Main>
  78. </Layout.Body>
  79. </PageFiltersContainer>
  80. </SentryDocumentTitle>
  81. );
  82. }
  83. const LayoutGap = styled('div')`
  84. margin-top: ${space(2)};
  85. `;
  86. const PaginationNoMargin = styled(Pagination)`
  87. margin: 0;
  88. `;