import React, { Component } from 'react';
export default class SourceIntensityController extends Component {
	constructor (props) {
		super (props)
		this.handleChange = this.handleChange.bind(this)
	}

	componentWillReceiveProps (nextProps) {
		if (nextProps.value !== -1)	 {
			// this.props.onChangeSimulateCircuit()
		}
	}

	handleChange (e) {
		this.props.IoTyActions.changeThresholdValue(e.target.value)
		// this.props.onChangeSimulateCircuit()
	}

	render() {
		let {
			value,
			min,
			max,
			step,
			orientation
		} = this.props
		return (
			<input 
				type='range'
				min={min}
				max={max}
				step={step}
				onChange={this.handleChange}
				value={value < min ? min : value} />
		);
	}
}