index.tsx 981 B

123456789101112131415161718192021222324252627282930313233
  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 type {RouteComponentProps} from 'sentry/types/legacyReactRouter';
  7. import useOrganization from 'sentry/utils/useOrganization';
  8. type Props = RouteComponentProps<{}, {}> & {
  9. children: React.ReactNode;
  10. };
  11. export default function FeedbackContainer({children}: Props) {
  12. const organization = useOrganization();
  13. return (
  14. <Feature
  15. features="user-feedback-ui"
  16. organization={organization}
  17. renderDisabled={NoAccess}
  18. >
  19. <NoProjectMessage organization={organization}>{children}</NoProjectMessage>
  20. </Feature>
  21. );
  22. }
  23. function NoAccess() {
  24. return (
  25. <Layout.Page withPadding>
  26. <Alert type="warning">{t("You don't have access to this feature")}</Alert>
  27. </Layout.Page>
  28. );
  29. }