toolbarResults.tsx 906 B

1234567891011121314151617181920212223242526
  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 {ToolbarHeading, 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. <ToolbarHeading>{t('Results')}</ToolbarHeading>
  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('Aggregate')}</SegmentedControl.Item>
  20. </SegmentedControl>
  21. </ToolbarSection>
  22. );
  23. }