grafana/public/app/features/dashboard/panel_editor/DataSourceOption.tsx

30 lines
726 B
TypeScript
Raw Normal View History

2019-01-29 06:42:29 -06:00
import React, { FC } from 'react';
import { FormLabel } from '@grafana/ui';
interface Props {
label: string;
placeholder?: string;
name?: string;
value?: string;
onChange?: (evt: any) => void;
tooltipInfo?: any;
}
export const DataSourceOptions: FC<Props> = ({ label, placeholder, name, value, onChange, tooltipInfo }) => {
2019-01-29 06:42:29 -06:00
return (
<div className="gf-form gf-form--flex-end">
2019-01-29 06:42:29 -06:00
<FormLabel tooltip={tooltipInfo}>{label}</FormLabel>
<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;