modulePageProviders.tsx 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import Feature from 'sentry/components/acl/feature';
  2. import * as Layout from 'sentry/components/layouts/thirds';
  3. import PageFiltersContainer from 'sentry/components/organizations/pageFilters/container';
  4. import SentryDocumentTitle from 'sentry/components/sentryDocumentTitle';
  5. import useOrganization from 'sentry/utils/useOrganization';
  6. import {NoAccess} from 'sentry/views/performance/database/noAccess';
  7. import {RoutingContextProvider} from 'sentry/views/starfish/utils/routingContext';
  8. interface Props {
  9. baseURL: string;
  10. children: React.ReactNode;
  11. features: string;
  12. title: string;
  13. }
  14. export function ModulePageProviders({title, children, features, baseURL}: Props) {
  15. const organization = useOrganization();
  16. return (
  17. <RoutingContextProvider value={{baseURL: baseURL}}>
  18. <PageFiltersContainer>
  19. <SentryDocumentTitle title={title} orgSlug={organization.slug}>
  20. <Layout.Page>
  21. <Feature
  22. features={features}
  23. organization={organization}
  24. renderDisabled={NoAccess}
  25. >
  26. {children}
  27. </Feature>
  28. </Layout.Page>
  29. </SentryDocumentTitle>
  30. </PageFiltersContainer>
  31. </RoutingContextProvider>
  32. );
  33. }