QueryPreview.tsx 577 B

12345678910111213141516171819202122
  1. import React from 'react';
  2. import { EditorField, EditorFieldGroup, EditorRow } from '@grafana/experimental';
  3. import { RawQuery } from '../../../prometheus/querybuilder/shared/RawQuery';
  4. import { lokiGrammar } from '../../syntax';
  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: lokiGrammar, name: 'lokiql' }} />
  14. </EditorField>
  15. </EditorFieldGroup>
  16. </EditorRow>
  17. );
  18. }