import { h, Component } from 'preact' import { connect } from 'react-redux' import { bindActionCreators } from 'redux' class SelectGroup extends Component { constructor(props){ super(props) this.handleChange = this.handleChange.bind(this) } handleChange(e){ clearTimeout(this.timeout) let new_value = e.target.value if (new_value === 'PLACEHOLDER') return this.props.onChange && this.props.onChange(this.props.name, new_value) } render() { const currentValue = this.props.live ? this.props.opt[this.props.name] : this.props.value let lastValue const options = (this.props.options || []).map((group, i) => { const groupName = group.name const children = group.options.map(key => { let name = key.length < 2 ? key.toUpperCase() : key let value = key.replace(/_/g, ' ') lastValue = value return ( ) }) return ( ) }) return (