index.tsx 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 {QueryClient, QueryClientProvider} from 'sentry/utils/queryClient';
  8. import withOrganization from 'sentry/utils/withOrganization';
  9. type Props = {
  10. children: React.ReactChildren;
  11. organization: Organization;
  12. };
  13. const queryClient = new QueryClient();
  14. function StarfishContainer({organization, children}: Props) {
  15. return (
  16. <Feature
  17. hookName="feature-disabled:starfish-view"
  18. features="starfish-view"
  19. organization={organization}
  20. renderDisabled={NoAccess}
  21. >
  22. <NoProjectMessage organization={organization}>
  23. <QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
  24. </NoProjectMessage>
  25. </Feature>
  26. );
  27. }
  28. function NoAccess() {
  29. return (
  30. <Layout.Page withPadding>
  31. <Alert type="warning">{t("You don't have access to this feature")}</Alert>
  32. </Layout.Page>
  33. );
  34. }
  35. export default withOrganization(StarfishContainer);