trc-client-core
Version:
The core of the TRC Client
39 lines (33 loc) • 1.17 kB
JSX
import React from 'react';
import Select from 'trc-client-core/src/components/Select';
var STREAMS = [
{value: 'ANY', label: 'All Streams'},
{value: 'ST_STC', label: 'Service Tech'},
{value: 'PT_PTC', label: 'Pro Tech'},
{value: 'DT_HYBC', label: 'Diagnosis Tech Hybrid'},
{value: 'DT_ELC', label: 'Diagnosis Tech Electrical'},
{value: 'DT_ENC', label: 'Diagnosis Tech Engine'},
{value: 'DT_CHC', label: 'Diagnosis Tech Chassis'},
{value: 'MT_CERT', label: 'Master Tech Certification'}
];
var RegionSelect = React.createClass({
displayName: 'Region Select',
propTypes: {
allOption: React.PropTypes.bool
},
getDefaultProps: function () {
return {
allOption: true
};
},
render: function() {
var streams = STREAMS;
if(!this.props.allOption) {
streams = STREAMS.filter(ii => ii.value !== 'ANY');
}
return (
<Select queryString name={this.props.name} value={this.props.value} options={streams} onChange={this.props.onChange}></Select>
);
}
});
module.exports = RegionSelect;