mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-06 13:35:44 +01:00
26 lines
484 B
JavaScript
26 lines
484 B
JavaScript
|
|
// @flow
|
||
|
|
|
||
|
|
import React from "react";
|
||
|
|
|
||
|
|
type Props = {
|
||
|
|
options: string[],
|
||
|
|
optionSelected: string => void
|
||
|
|
}
|
||
|
|
|
||
|
|
class DropDown extends React.Component<Props> {
|
||
|
|
render() {
|
||
|
|
const {options} = this.props;
|
||
|
|
return <select onChange={this.change}>
|
||
|
|
{options.map(option => {
|
||
|
|
return <option key={option} value={option}>{option}</option>
|
||
|
|
})}
|
||
|
|
</select>
|
||
|
|
}
|
||
|
|
|
||
|
|
change = (event) => {
|
||
|
|
this.props.optionSelected(event.target.value);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
export default DropDown;
|