projectionPeriodControl.tsx 897 B

123456789101112131415161718192021222324252627
  1. import {SegmentedControl} from 'sentry/components/segmentedControl';
  2. import {Tooltip} from 'sentry/components/tooltip';
  3. import {t} from 'sentry/locale';
  4. import type {ProjectionSamplePeriod} from 'sentry/views/settings/dynamicSampling/utils/useProjectSampleCounts';
  5. interface Props {
  6. onChange: (period: ProjectionSamplePeriod) => void;
  7. period: ProjectionSamplePeriod;
  8. }
  9. export function ProjectionPeriodControl({period, onChange}: Props) {
  10. return (
  11. <Tooltip
  12. title={t('The time period for which the estimated sample rates are calculated.')}
  13. >
  14. <SegmentedControl
  15. label={t('Stats period')}
  16. value={period}
  17. onChange={onChange}
  18. size="xs"
  19. >
  20. <SegmentedControl.Item key="24h">{t('24h')}</SegmentedControl.Item>
  21. <SegmentedControl.Item key="30d">{t('30d')}</SegmentedControl.Item>
  22. </SegmentedControl>
  23. </Tooltip>
  24. );
  25. }