Moved panel editing components to it's own folder

This commit is contained in:
Torkel Ödegaard
2019-01-14 15:17:48 +01:00
parent b9a3239edb
commit 827a292777
14 changed files with 2 additions and 104 deletions

View File

@@ -0,0 +1,31 @@
import React, { SFC } from 'react';
import { Tooltip } from '@grafana/ui';
interface Props {
label: string;
placeholder?: string;
name?: string;
value?: string;
onChange?: (evt: any) => void;
tooltipInfo?: any;
}
export const DataSourceOptions: SFC<Props> = ({ label, placeholder, name, value, onChange, tooltipInfo }) => {
const dsOption = (
<div className="gf-form gf-form--flex-end">
<label className="gf-form-label">{label}</label>
<input
type="text"
className="gf-form-input width-6"
placeholder={placeholder}
name={name}
spellCheck={false}
onBlur={evt => onChange(evt.target.value)}
/>
</div>
);
return tooltipInfo ? <Tooltip content={tooltipInfo}>{dsOption}</Tooltip> : dsOption;
};
export default DataSourceOptions;