listContent.tsx 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. import {Fragment} from 'react';
  2. import {useHaveSelectedProjectsSentAnyReplayEvents} from 'sentry/utils/replays/hooks/useReplayOnboarding';
  3. import useOrganization from 'sentry/utils/useOrganization';
  4. import ReplaysFilters from 'sentry/views/replays/list/filters';
  5. import ReplayOnboardingPanel from 'sentry/views/replays/list/replayOnboardingPanel';
  6. import ReplaysErroneousDeadRageCards from 'sentry/views/replays/list/replaysErroneousDeadRageCards';
  7. import ReplaysList from 'sentry/views/replays/list/replaysList';
  8. import ReplaysSearch from 'sentry/views/replays/list/search';
  9. export default function ListContent() {
  10. const organization = useOrganization();
  11. const hasSessionReplay = organization.features.includes('session-replay');
  12. const {hasSentOneReplay, fetching} = useHaveSelectedProjectsSentAnyReplayEvents();
  13. const showOnboarding = !hasSessionReplay || !hasSentOneReplay;
  14. return fetching ? null : showOnboarding ? (
  15. <Fragment>
  16. <ReplaysFilters>
  17. <ReplaysSearch />
  18. </ReplaysFilters>
  19. <ReplayOnboardingPanel />
  20. </Fragment>
  21. ) : (
  22. <Fragment>
  23. <ReplaysFilters />
  24. <ReplaysErroneousDeadRageCards />
  25. <ReplaysSearch />
  26. <ReplaysList />
  27. </Fragment>
  28. );
  29. }