index.tsx 963 B

12345678910111213141516171819202122232425262728293031323334
  1. import {RouteComponentProps} from 'react-router';
  2. import Feature from 'sentry/components/acl/feature';
  3. import Alert from 'sentry/components/alert';
  4. import * as Layout from 'sentry/components/layouts/thirds';
  5. import NoProjectMessage from 'sentry/components/noProjectMessage';
  6. import {t} from 'sentry/locale';
  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. }