Split packages into platform and extensions

This commit is contained in:
dannyrb committed 2019-07-08 00:41:25 -04:00
1 parent f175d4b96b
commit e8969fba11
992 files changed
+2 -1

No files matched your search

+48
View File
@@ -0,0 +1,48 @@
import './Select.css';
import React, { Component } from 'react';
import PropTypes from 'prop-types';
class Select extends Component {
constructor(props) {
super(props);
this.state = { value: this.props.value };
}
handleChange = event => {
this.setState({ value: event.target.value });
if (this.props.onChange) this.props.onChange();
};
render() {
return (
<select
className="select-ohif"
value={this.state.selected}
onChange={this.handleChange}
>
{this.props.options.map(({ key, value }) => {
return (
<option key={key} value={value}>
{key}
</option>
);
})}
</select>
);
}
}
Select.propTypes = {
options: PropTypes.arrayOf(
PropTypes.shape({
key: PropTypes.string.isRequired,
value: PropTypes.string.isRequired,
})
),
value: PropTypes.string,
onChange: PropTypes.func,
};
export { Select };