projectSupportsReplay.tsx 774 B

1234567891011121314151617181920212223242526272829
  1. import {backend, replayPlatforms} from 'sentry/data/platformCategories';
  2. import type {MinimalProject} from 'sentry/types';
  3. /**
  4. * Are you able to send a Replay into the project?
  5. *
  6. * Basically: is this a frontend project
  7. */
  8. function projectSupportsReplay(project: MinimalProject) {
  9. return Boolean(project.platform && replayPlatforms.includes(project.platform));
  10. }
  11. /**
  12. * Can this project be related to a Replay?
  13. *
  14. * Basically: is this a backend or frontend project
  15. */
  16. export function projectCanLinkToReplay(project: undefined | MinimalProject) {
  17. if (!project || !project.platform) {
  18. return false;
  19. }
  20. return (
  21. replayPlatforms.includes(project.platform) ||
  22. backend.some(val => val === project.platform)
  23. );
  24. }
  25. export default projectSupportsReplay;