index.tsx 950 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import {Component} from 'react';
  2. import Feature from 'app/components/acl/feature';
  3. import Alert from 'app/components/alert';
  4. import {t} from 'app/locale';
  5. import {PageContent} from 'app/styles/organization';
  6. import {Organization} from 'app/types';
  7. import withOrganization from 'app/utils/withOrganization';
  8. type Props = {
  9. organization: Organization;
  10. };
  11. class DiscoverContainer extends Component<Props> {
  12. renderNoAccess() {
  13. return (
  14. <PageContent>
  15. <Alert type="warning">{t("You don't have access to this feature")}</Alert>
  16. </PageContent>
  17. );
  18. }
  19. render() {
  20. const {organization, children} = this.props;
  21. return (
  22. <Feature
  23. features={['discover-basic']}
  24. organization={organization}
  25. hookName="feature-disabled:discover2-page"
  26. renderDisabled={this.renderNoAccess}
  27. >
  28. {children}
  29. </Feature>
  30. );
  31. }
  32. }
  33. export default withOrganization(DiscoverContainer);