index.tsx 928 B

1234567891011121314151617181920212223242526272829303132333435
  1. import {RouteComponentProps} from 'react-router';
  2. import Feature from 'sentry/components/acl/feature';
  3. import Alert from 'sentry/components/alert';
  4. import {t} from 'sentry/locale';
  5. import {PageContent} from 'sentry/styles/organization';
  6. import {Organization} from 'sentry/types';
  7. import withOrganization from 'sentry/utils/withOrganization';
  8. type Props = RouteComponentProps<{}, {}> & {
  9. children: React.ReactChildren;
  10. organization: Organization;
  11. };
  12. function ReplaysContainer({organization, children}: Props) {
  13. function renderNoAccess() {
  14. return (
  15. <PageContent>
  16. <Alert type="warning">{t("You don't have access to this feature")}</Alert>
  17. </PageContent>
  18. );
  19. }
  20. return (
  21. <Feature
  22. features={['session-replay-ui']}
  23. organization={organization}
  24. renderDisabled={renderNoAccess}
  25. >
  26. {children}
  27. </Feature>
  28. );
  29. }
  30. export default withOrganization(ReplaysContainer);