intervalSelect.tsx 527 B

123456789101112131415161718
  1. import {CompactSelect} from 'sentry/components/compactSelect';
  2. import {t} from 'sentry/locale';
  3. import {useMetricsIntervalParam} from 'sentry/views/metrics/utils/useMetricsIntervalParam';
  4. export function IntervalSelect() {
  5. const {interval, setInterval, currentIntervalOptions} = useMetricsIntervalParam();
  6. return (
  7. <CompactSelect
  8. value={interval}
  9. onChange={({value}) => setInterval(value)}
  10. triggerProps={{
  11. prefix: t('Interval'),
  12. }}
  13. options={currentIntervalOptions}
  14. />
  15. );
  16. }