2019-01-29 06:42:29 -06:00
|
|
|
import React, { FC } from 'react';
|
|
|
|
import { FormLabel } from '@grafana/ui';
|
2018-11-20 09:33:26 -06:00
|
|
|
|
|
|
|
interface Props {
|
|
|
|
label: string;
|
|
|
|
placeholder?: string;
|
|
|
|
name?: string;
|
|
|
|
value?: string;
|
|
|
|
onChange?: (evt: any) => void;
|
|
|
|
tooltipInfo?: any;
|
|
|
|
}
|
|
|
|
|
2019-01-17 02:27:43 -06:00
|
|
|
export const DataSourceOptions: FC<Props> = ({ label, placeholder, name, value, onChange, tooltipInfo }) => {
|
2019-01-29 06:42:29 -06:00
|
|
|
return (
|
2018-11-20 09:33:26 -06:00
|
|
|
<div className="gf-form gf-form--flex-end">
|
2019-01-29 06:42:29 -06:00
|
|
|
<FormLabel tooltip={tooltipInfo}>{label}</FormLabel>
|
2018-11-20 09:33:26 -06:00
|
|
|
<input
|
|
|
|
type="text"
|
|
|
|
className="gf-form-input width-6"
|
|
|
|
placeholder={placeholder}
|
|
|
|
name={name}
|
|
|
|
spellCheck={false}
|
|
|
|
onBlur={evt => onChange(evt.target.value)}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default DataSourceOptions;
|