index.tsx 895 B

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