modulePageProviders.tsx 1.2 KB

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