chartControls.tsx 766 B

123456789101112131415161718192021222324252627282930
  1. import type {Location} from 'history';
  2. import OptionSelector from 'sentry/components/charts/optionSelector';
  3. import {t} from 'sentry/locale';
  4. import Histogram from 'sentry/utils/performance/histogram';
  5. import {ZOOM_END, ZOOM_START} from './utils';
  6. type Props = {
  7. location: Location;
  8. };
  9. function ChartControls({location}: Props) {
  10. return (
  11. <Histogram location={location} zoomKeys={[ZOOM_START, ZOOM_END]}>
  12. {({filterOptions, handleFilterChange, activeFilter}) => {
  13. return (
  14. <OptionSelector
  15. title={t('Outliers')}
  16. selected={activeFilter.value}
  17. options={filterOptions}
  18. onChange={handleFilterChange}
  19. />
  20. );
  21. }}
  22. </Histogram>
  23. );
  24. }
  25. export default ChartControls;