grafana/public/app/plugins/datasource/cloudwatch/components/Forms.tsx
Tobias Skarhed 7e4292508f
Form migrations: Final components to LegacyForms (#23707)
* FormField to LegacyForms

* FormLabel to InlineFormLabel

* Move SecretFormField to LeagcyForms
2020-04-21 11:42:21 +02:00

29 lines
800 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>
);
};