modulePageProviders.tsx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  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. children: React.ReactNode;
  10. title: string;
  11. baseURL?: string;
  12. }
  13. export function ModulePageProviders({title, children, baseURL}: Props) {
  14. const organization = useOrganization();
  15. return (
  16. <RoutingContextProvider value={{baseURL: baseURL || '/performance/database'}}>
  17. <PageFiltersContainer>
  18. <SentryDocumentTitle title={title} orgSlug={organization.slug}>
  19. <Layout.Page>
  20. <Feature
  21. features="performance-database-view"
  22. organization={organization}
  23. renderDisabled={NoAccess}
  24. >
  25. {children}
  26. </Feature>
  27. </Layout.Page>
  28. </SentryDocumentTitle>
  29. </PageFiltersContainer>
  30. </RoutingContextProvider>
  31. );
  32. }