DataSourceOption.tsx 726 B

1234567891011121314151617181920212223242526272829
  1. import React, { FC } from 'react';
  2. import { FormLabel } from '@grafana/ui';
  3. interface Props {
  4. label: string;
  5. placeholder?: string;
  6. name?: string;
  7. value?: string;
  8. onChange?: (evt: any) => void;
  9. tooltipInfo?: any;
  10. }
  11. export const DataSourceOptions: FC<Props> = ({ label, placeholder, name, value, onChange, tooltipInfo }) => {
  12. return (
  13. <div className="gf-form gf-form--flex-end">
  14. <FormLabel tooltip={tooltipInfo}>{label}</FormLabel>
  15. <input
  16. type="text"
  17. className="gf-form-input width-6"
  18. placeholder={placeholder}
  19. name={name}
  20. spellCheck={false}
  21. onBlur={evt => onChange(evt.target.value)}
  22. />
  23. </div>
  24. );
  25. };
  26. export default DataSourceOptions;