mirror of
https://github.com/grafana/grafana.git
synced 2025-02-20 11:48:34 -06:00
* Add and configure eslint-plugin-import * Fix the lint:ts npm command * Autofix + prettier all the files * Manually fix remaining files * Move jquery code in jest-setup to external file to safely reorder imports * Resolve issue caused by circular dependencies within Prometheus * Update .betterer.results * Fix missing // @ts-ignore * ignore iconBundle.ts * Fix missing // @ts-ignore
30 lines
801 B
TypeScript
30 lines
801 B
TypeScript
import React, { InputHTMLAttributes, FunctionComponent } from 'react';
|
|
|
|
import { InlineFormLabel } from '@grafana/ui';
|
|
|
|
export interface Props extends InputHTMLAttributes<HTMLInputElement> {
|
|
label: string;
|
|
tooltip?: string;
|
|
children?: React.ReactNode;
|
|
}
|
|
|
|
export const QueryField: FunctionComponent<Partial<Props>> = ({ label, tooltip, children }) => (
|
|
<>
|
|
<InlineFormLabel width={8} className="query-keyword" tooltip={tooltip}>
|
|
{label}
|
|
</InlineFormLabel>
|
|
{children}
|
|
</>
|
|
);
|
|
|
|
export const QueryInlineField: FunctionComponent<Props> = ({ ...props }) => {
|
|
return (
|
|
<div className={'gf-form-inline'}>
|
|
<QueryField {...props} />
|
|
<div className="gf-form gf-form--grow">
|
|
<div className="gf-form-label gf-form-label--grow" />
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|