SeriesSection.tsx 651 B

1234567891011121314151617181920212223242526
  1. import React from 'react';
  2. import { SegmentSection } from '@grafana/ui';
  3. import { GraphiteQueryEditorState } from '../state/store';
  4. import { MetricsSection } from './MetricsSection';
  5. import { TagsSection } from './TagsSection';
  6. type Props = {
  7. state: GraphiteQueryEditorState;
  8. };
  9. export function SeriesSection({ state }: Props) {
  10. const sectionContent = state.queryModel?.seriesByTagUsed ? (
  11. <TagsSection tags={state.queryModel?.tags} state={state} />
  12. ) : (
  13. <MetricsSection segments={state.segments} state={state} />
  14. );
  15. return (
  16. <SegmentSection label="Series" fill={true}>
  17. {sectionContent}
  18. </SegmentSection>
  19. );
  20. }