toolbarDataset.tsx 1000 B

12345678910111213141516171819202122232425262728
  1. import {SegmentedControl} from 'sentry/components/segmentedControl';
  2. import {t} from 'sentry/locale';
  3. import {DiscoverDatasets} from 'sentry/utils/discover/types';
  4. import {ToolbarHeader, ToolbarLabel, 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. <ToolbarHeader>
  13. <ToolbarLabel>{t('Dataset')}</ToolbarLabel>
  14. </ToolbarHeader>
  15. <SegmentedControl aria-label={t('Dataset')} value={dataset} onChange={setDataset}>
  16. <SegmentedControl.Item key={DiscoverDatasets.SPANS_EAP}>
  17. {t('EAP Spans')}
  18. </SegmentedControl.Item>
  19. <SegmentedControl.Item key={DiscoverDatasets.SPANS_INDEXED}>
  20. {t('Indexed Spans')}
  21. </SegmentedControl.Item>
  22. </SegmentedControl>
  23. </ToolbarSection>
  24. );
  25. }