text: import Slide from '/components/mind-cave/slide.inc.js';
  
  import addSlide from '/actions/mind-cave/add-slide.inc.js';
  
  
  /**
   * This component renders the slide show container and automatically adds a
   * new slide every six seconds.
   */
  class SlideShow extends React.Component
  {
  	/**
  	 * Add the initial slide and set up an interval to keep adding slides.
  	 */
  	componentDidMount ()
  	{
  		this.props.addSlide();
  
  		setInterval(this.props.addSlide, 6000);
  	}
  
  
  	/**
  	 * Render the container and any existing slides.
  	 */
  	render ()
  	{
  		return(
  			<>
  				{this.props.slides.map(slide => <Slide key={slide.index} index={slide.index} image={slide.image}/>)}
  			</>
  		);
  	}
  }
  
  
  /**
   * Connect the component to the Redux store.
   */
  const container = ReactRedux.connect(mapStateToProps, mapDispatchToProps)(SlideShow);
  
  /**
   * Map state to props.
   * i: state object
   */
  function mapStateToProps (state)
  {
  	return {
  		slides: state.slides
  	};
  }
  
  /**
   * Map dispatch to props.
   * i: dispatch method
   */
  function mapDispatchToProps (dispatch)
  {
  	return Redux.bindActionCreators({ addSlide }, dispatch);
  }
  
  
  export default container;
  