grafana/public/app/features/dashboard/panel_editor/DataSourceOption.tsx
Peter Holmberg 4898502e4e
refactor(grafana/ui): Replace <input />with Input component from grafana/ui (#16085)
* replace with Input component from grafana/ui

* removing placeholder classname

* change import

* fix import
2019-03-25 15:53:05 +01:00

31 lines
824 B
TypeScript

import React, { FC, ChangeEvent } from 'react';
import { FormLabel, Input } from '@grafana/ui';
interface Props {
label: string;
placeholder?: string;
name: string;
value: string;
onBlur: (event: ChangeEvent<HTMLInputElement>) => void;
onChange: (event: ChangeEvent<HTMLInputElement>) => void;
tooltipInfo?: any;
}
export const DataSourceOption: FC<Props> = ({ label, placeholder, name, value, onBlur, onChange, tooltipInfo }) => {
return (
<div className="gf-form gf-form--flex-end">
<FormLabel tooltip={tooltipInfo}>{label}</FormLabel>
<Input
type="text"
className="gf-form-input width-6"
placeholder={placeholder}
name={name}
spellCheck={false}
onBlur={onBlur}
onChange={onChange}
value={value}
/>
</div>
);
};