content: import React from 'react';
  
  import _ from 'lodash';
  
  import { EngineWarnings } from '../../constants';
  
  const Warnings = React.createClass({
      propTypes: {
          warnings: React.PropTypes.array
      },
  
      getDefaultProps: function() {
          return {
              warnings: []
          }
      }, 
  
      shouldComponentUpdate: function(nextProps, nextState) {
          return this.props.warnings != nextProps.warnings;
      },
  
      render: function() {
          let warnings = [];
  
          if (_.indexOf(this.props.warnings, EngineWarnings.PIT_SPEED_LIMITER) != -1) {
              warnings.push(
                  <div key="pit-speed-limiter" id="pit-speed-limiter" className="column">
                      Pit Speed Limiter
                  </div>
              );
          }
  
          if (_.indexOf(this.props.warnings, EngineWarnings.REV_LIMITER_ACTIVE) != -1) {
              warnings.push(
                  <div key="rev-limiter" id="rev-limiter" className="column">
                      Rev Limiter Active
                  </div>
              );
          }
  
          if (_.indexOf(this.props.warnings, EngineWarnings.WATER_TEMP_WARNING) != -1) {
              warnings.push(
                  <div key="water-temp" id="water-temp" className="column">
                      Engine Hot
                  </div>
              );
          }
  
          if (_.indexOf(this.props.warnings, EngineWarnings.FUEL_PRESSURE_WARNING) != -1) {
              warnings.push(
                  <div key="fuel-pressure" id="fuel-pressure" className="column">
                      Fuel Pressure Low
                  </div>
              );
          }
  
          if (_.indexOf(this.props.warnings, EngineWarnings.OIL_PRESSURE_WARNING) != -1) {
              warnings.push(
                  <div key="oil-pressure" id="oil-pressure" className="column">
                      Oil Pressue Low
                  </div>
              );
          }
  
          if (_.indexOf(this.props.warnings, EngineWarnings.ENGINE_STALLED) != -1) {
              warnings.push(
                  <div key="engine-stalled" id="engine-stalled" className="column">
                      Engine Stalled
                  </div>
              );
          }
  
          return (
              <div id="engine-warnings" className="row">
                  {warnings}
              </div>
          );
      }
  });
  
  export default Warnings;
  