Files
grafana/public/app/plugins/datasource/stackdriver/components/SimpleSelect.tsx

29 lines
728 B
TypeScript
Raw Normal View History

2018-10-26 15:57:01 +02:00
import React, { SFC } from 'react';
interface Props {
onValueChange: any;
options: any;
value: string;
label: string;
2018-10-26 15:57:01 +02:00
}
2018-10-31 13:55:40 +01:00
const SimpleSelect: SFC<Props> = props => {
const { label, onValueChange, value, options } = props;
2018-10-26 15:57:01 +02:00
return (
<div className="gf-form max-width-21">
2018-11-01 09:46:01 +01:00
<span className="gf-form-label width-10">{label}</span>
<div className="gf-form-select-wrapper max-width-10">
<select className="gf-form-input" required onChange={onValueChange} value={value}>
{options.map(({ value, name }, i) => (
<option key={i} value={value}>
{name}
</option>
))}
</select>
</div>
</div>
);
};
2018-10-31 13:55:40 +01:00
export default SimpleSelect;