toolbarDataset.tsx 944 B

1234567891011121314151617181920212223242526
  1. import {SegmentedControl} from 'sentry/components/segmentedControl';
  2. import {t} from 'sentry/locale';
  3. import {DiscoverDatasets} from 'sentry/utils/discover/types';
  4. import {ToolbarHeading, ToolbarSection} from './styles';
  5. interface ToolbarDatasetProps {
  6. dataset: DiscoverDatasets;
  7. setDataset: (newExploreDataset: DiscoverDatasets) => void;
  8. }
  9. export function ToolbarDataset({dataset, setDataset}: ToolbarDatasetProps) {
  10. return (
  11. <ToolbarSection data-test-id="section-dataset">
  12. <ToolbarHeading>{t('Dataset')}</ToolbarHeading>
  13. <SegmentedControl aria-label={t('Dataset')} value={dataset} onChange={setDataset}>
  14. <SegmentedControl.Item key={DiscoverDatasets.SPANS_INDEXED}>
  15. {t('Indexed Spans')}
  16. </SegmentedControl.Item>
  17. <SegmentedControl.Item key={DiscoverDatasets.SPANS_EAP}>
  18. {t('EAP Spans')}
  19. </SegmentedControl.Item>
  20. </SegmentedControl>
  21. </ToolbarSection>
  22. );
  23. }