index.tsx 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import Feature from 'sentry/components/acl/feature';
  2. import Alert from 'sentry/components/alert';
  3. import AnalyticsArea from 'sentry/components/analyticsArea';
  4. import * as Layout from 'sentry/components/layouts/thirds';
  5. import NoProjectMessage from 'sentry/components/noProjectMessage';
  6. import {t} from 'sentry/locale';
  7. import type {RouteComponentProps} from 'sentry/types/legacyReactRouter';
  8. import useOrganization from 'sentry/utils/useOrganization';
  9. type Props = RouteComponentProps<{}, {}> & {
  10. children: React.ReactNode;
  11. };
  12. export default function FeedbackContainer({children}: Props) {
  13. const organization = useOrganization();
  14. return (
  15. <Feature
  16. features="user-feedback-ui"
  17. organization={organization}
  18. renderDisabled={NoAccess}
  19. >
  20. <AnalyticsArea name="feedback">
  21. <NoProjectMessage organization={organization}>{children}</NoProjectMessage>
  22. </AnalyticsArea>
  23. </Feature>
  24. );
  25. }
  26. function NoAccess() {
  27. return (
  28. <Layout.Page withPadding>
  29. <Alert type="warning">{t("You don't have access to this feature")}</Alert>
  30. </Layout.Page>
  31. );
  32. }