index.tsx 863 B

1234567891011121314151617181920212223242526272829
  1. import * as React from 'react';
  2. import Feature from 'app/components/acl/feature';
  3. import Alert from 'app/components/alert';
  4. import {t} from 'app/locale';
  5. import {PageContent} from 'app/styles/organization';
  6. import withOrganization from 'app/utils/withOrganization';
  7. import WidgetBuilder from './widgetBuilder';
  8. type Props = React.ComponentProps<typeof WidgetBuilder>;
  9. function WidgetBuilderContainer({organization, ...props}: Props) {
  10. return (
  11. <Feature
  12. features={['metrics', 'dashboards-edit']}
  13. organization={organization}
  14. renderDisabled={() => (
  15. <PageContent>
  16. <Alert type="warning">{t("You don't have access to this feature")}</Alert>
  17. </PageContent>
  18. )}
  19. >
  20. <WidgetBuilder {...props} organization={organization} />
  21. </Feature>
  22. );
  23. }
  24. export default withOrganization(WidgetBuilderContainer);