import { css } from '@emotion/css'; import React, { FC, useCallback, useState } from 'react'; import { GrafanaTheme } from '@grafana/data'; import { selectors } from '@grafana/e2e-selectors'; import { useStyles } from '@grafana/ui'; import { VariableQueryEditorProps } from '../types'; import { VariableTextAreaField } from './VariableTextAreaField'; export const LEGACY_VARIABLE_QUERY_EDITOR_NAME = 'Grafana-LegacyVariableQueryEditor'; export const LegacyVariableQueryEditor: FC = ({ onChange, query }) => { const styles = useStyles(getStyles); const [value, setValue] = useState(query); const onValueChange = (event: React.FormEvent) => { setValue(event.currentTarget.value); }; const onBlur = useCallback( (event: React.FormEvent) => { onChange(event.currentTarget.value, event.currentTarget.value); }, [onChange] ); return (
); }; function getStyles(theme: GrafanaTheme) { return { container: css` margin-bottom: ${theme.spacing.xs}; `, }; } LegacyVariableQueryEditor.displayName = LEGACY_VARIABLE_QUERY_EDITOR_NAME;