QueryPreview.tsx 547 B

12345678910111213141516171819202122
  1. import React from 'react';
  2. import { EditorField, EditorFieldGroup, EditorRow } from '@grafana/experimental';
  3. import promqlGrammar from '../../promql';
  4. import { RawQuery } from '../shared/RawQuery';
  5. export interface Props {
  6. query: string;
  7. }
  8. export function QueryPreview({ query }: Props) {
  9. return (
  10. <EditorRow>
  11. <EditorFieldGroup>
  12. <EditorField label="Raw query">
  13. <RawQuery query={query} lang={{ grammar: promqlGrammar, name: 'promql' }} />
  14. </EditorField>
  15. </EditorFieldGroup>
  16. </EditorRow>
  17. );
  18. }