content.tsx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. import {useTheme} from '@emotion/react';
  2. import {Location} from 'history';
  3. import first from 'lodash/first';
  4. import * as Layout from 'sentry/components/layouts/thirds';
  5. import Pagination from 'sentry/components/pagination';
  6. import type {Organization} from 'sentry/types';
  7. import EventView from 'sentry/utils/discover/eventView';
  8. import useMedia from 'sentry/utils/useMedia';
  9. import ReplayTable from 'sentry/views/replays/replayTable';
  10. import {ReplayColumns} from 'sentry/views/replays/replayTable/types';
  11. import type {ReplayListLocationQuery} from 'sentry/views/replays/types';
  12. import type {SpanOperationBreakdownFilter} from '../filter';
  13. import {EventsDisplayFilterName, PercentileValues} from '../transactionEvents/utils';
  14. import type {ReplayListRecordWithTx} from './useReplaysFromTransaction';
  15. type Props = {
  16. eventView: EventView;
  17. eventsDisplayFilterName: EventsDisplayFilterName;
  18. isFetching: boolean;
  19. location: Location<ReplayListLocationQuery>;
  20. organization: Organization;
  21. pageLinks: string | null;
  22. replays: ReplayListRecordWithTx[];
  23. spanOperationBreakdownFilter: SpanOperationBreakdownFilter;
  24. percentileValues?: PercentileValues;
  25. };
  26. function ReplaysContent({eventView, isFetching, pageLinks, replays}: Props) {
  27. const theme = useTheme();
  28. const hasRoomForColumns = useMedia(`(min-width: ${theme.breakpoints.small})`);
  29. return (
  30. <Layout.Main fullWidth>
  31. <ReplayTable
  32. fetchError={undefined}
  33. isFetching={isFetching}
  34. replays={replays}
  35. sort={first(eventView.sorts) || {field: 'started_at', kind: 'asc'}}
  36. visibleColumns={[
  37. ReplayColumns.session,
  38. ...(hasRoomForColumns
  39. ? [ReplayColumns.slowestTransaction, ReplayColumns.startedAt]
  40. : []),
  41. ReplayColumns.duration,
  42. ReplayColumns.countErrors,
  43. ReplayColumns.activity,
  44. ]}
  45. />
  46. <Pagination pageLinks={pageLinks} />
  47. </Layout.Main>
  48. );
  49. }
  50. export default ReplaysContent;