@bbc/react-transcript-editor
Version:
A React component to make transcribing audio and video easier and faster.
30 lines (27 loc) • 789 B
JavaScript
import React from 'react';
import PropTypes from 'prop-types';
import style from './Select.module.css';
class Select extends React.Component {
render() {
const options = this.props.options.map((option, index) => {
// eslint-disable-next-line react/no-array-index-key
return React.createElement("option", {
key: index,
value: option.value
}, option.label);
});
return React.createElement("select", {
className: style.selectPlayerControl,
name: this.props.name,
value: this.props.currentValue,
onChange: this.props.handleChange
}, options);
}
}
Select.propTypes = {
options: PropTypes.array,
name: PropTypes.string,
currentValue: PropTypes.string,
handleChange: PropTypes.func
};
export default Select;