toolbarResults.tsx 904 B

123456789101112131415161718192021222324252627
  1. import {SegmentedControl} from 'sentry/components/segmentedControl';
  2. import {t} from 'sentry/locale';
  3. import type {ResultMode} from 'sentry/views/explore/hooks/useResultsMode';
  4. import {ToolbarRow, ToolbarSection} from './styles';
  5. interface ToolbarResultsProps {
  6. resultMode: ResultMode;
  7. setResultMode: (newMode: ResultMode) => void;
  8. }
  9. export function ToolbarResults({resultMode, setResultMode}: ToolbarResultsProps) {
  10. return (
  11. <ToolbarSection data-test-id="section-result-mode">
  12. <ToolbarRow>
  13. <SegmentedControl
  14. aria-label={t('Result Mode')}
  15. value={resultMode}
  16. onChange={setResultMode}
  17. >
  18. <SegmentedControl.Item key="samples">{t('Samples')}</SegmentedControl.Item>
  19. <SegmentedControl.Item key="aggregate">{t('Aggregates')}</SegmentedControl.Item>
  20. </SegmentedControl>
  21. </ToolbarRow>
  22. </ToolbarSection>
  23. );
  24. }