Skip to content

Instantly share code, notes, and snippets.

View mckn's full-sized avatar

Marcus Andersson mckn

  • Stockholm, Sweden
View GitHub Profile
@mckn
mckn / queryEditor.tsx
Created October 9, 2023 08:08
Example: query editor with some options
import React, { ReactElement } from 'react';
import { css } from '@emotion/css';
import { useStyles2, Segment } from '@grafana/ui';
import { GrafanaTheme2, SelectableValue } from '@grafana/data';
import type { EditorProps } from './types';
import { useAsync } from 'react-use';
export function QueryEditor(props: EditorProps): ReactElement {
const { query } = props;
const { dimensions } = query;