index.tsx 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import Feature from 'sentry/components/acl/feature';
  2. import {Alert} from 'sentry/components/alert';
  3. import * as Layout from 'sentry/components/layouts/thirds';
  4. import NoProjectMessage from 'sentry/components/noProjectMessage';
  5. import {t} from 'sentry/locale';
  6. import {Organization} from 'sentry/types';
  7. import withOrganization from 'sentry/utils/withOrganization';
  8. type Props = {
  9. children: React.ReactChildren;
  10. organization: Organization;
  11. };
  12. function DiscoverContainer({organization, children}: Props) {
  13. function renderNoAccess() {
  14. return (
  15. <Layout.Page withPadding>
  16. <Alert type="warning">{t("You don't have access to this feature")}</Alert>
  17. </Layout.Page>
  18. );
  19. }
  20. return (
  21. <Feature
  22. features={['discover-basic']}
  23. organization={organization}
  24. hookName="feature-disabled:discover2-page"
  25. renderDisabled={renderNoAccess}
  26. >
  27. <NoProjectMessage organization={organization}>{children}</NoProjectMessage>
  28. </Feature>
  29. );
  30. }
  31. export default withOrganization(DiscoverContainer);