import { css } from '@emotion/css'; import React, { FormEvent, PropsWithChildren, ReactElement, useCallback } from 'react'; import { GrafanaTheme } from '@grafana/data'; import { InlineField, TextArea, useStyles } from '@grafana/ui'; interface VariableTextAreaFieldProps { name: string; value: string; placeholder: string; onChange: (event: FormEvent) => void; width: number; tooltip?: string; ariaLabel?: string; required?: boolean; labelWidth?: number; testId?: string; onBlur?: (event: FormEvent) => void; } export function VariableTextAreaField({ name, value, placeholder, tooltip, onChange, onBlur, ariaLabel, required, width, labelWidth, testId, }: PropsWithChildren>): ReactElement { const styles = useStyles(getStyles); const getLineCount = useCallback((value: any) => { if (value && typeof value === 'string') { return value.split('\n').length; } return 1; }, []); return (