index.tsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import {RouteComponentProps} from 'react-router';
  2. import Access from 'sentry/components/acl/access';
  3. import Feature from 'sentry/components/acl/feature';
  4. import FeatureDisabled from 'sentry/components/acl/featureDisabled';
  5. import {PanelAlert} from 'sentry/components/panels';
  6. import {t} from 'sentry/locale';
  7. import {Project} from 'sentry/types';
  8. import {SamplingRuleType} from 'sentry/types/sampling';
  9. import useOrganization from 'sentry/utils/useOrganization';
  10. import {Sampling} from './sampling';
  11. type Props = RouteComponentProps<{ruleType: SamplingRuleType}, {}> & {
  12. project: Project;
  13. };
  14. /**
  15. * This is will be replaced by the new Server Side Sampling UI.
  16. *
  17. * @deprecated
  18. */
  19. function Index(props: Props) {
  20. const organization = useOrganization();
  21. return (
  22. <Feature
  23. features={['filters-and-sampling']}
  24. organization={organization}
  25. renderDisabled={() => (
  26. <FeatureDisabled
  27. alert={PanelAlert}
  28. features={['organization:filters-and-sampling']}
  29. featureName={t('Sampling')}
  30. />
  31. )}
  32. >
  33. <Access organization={organization} access={['project:write']}>
  34. {({hasAccess}) => (
  35. <Sampling {...props} hasAccess={hasAccess} organization={organization} />
  36. )}
  37. </Access>
  38. </Feature>
  39. );
  40. }
  41. export default Index;