text: // create a new component
  // this component should produce some html
  
  // take this components generated html and put it on the page (aka in the DOM)
  import _ from 'lodash';
  import React, { Component } from 'react';
  import ReactDOM from 'react-dom';
  import SearchBar from './components/search_bar';
  import VideoList from './components/video_list';
  import VideoDetail from './components/video_detail';
  import YTSearch from 'youtube-api-search';
  
  
  const API_KEY = 'AIzaSyBjLci1Pp-75JSezytc4nqg-NU-lhw4m_k';
  
  class App extends Component {
    constructor(props) {
      super(props);
  
      this.state = { 
        videos: [],
        selectedVideo: null
     };
  
     this.videoSearch('boston manor');
    }
  
    videoSearch(term) {
      YTSearch({key: API_KEY, term: term}, videos => {
        this.setState({ 
          videos: videos,
          selectedVideo: videos[0]
        });
      });
    } 
  
    render() {
  
      const videoSearch = _.debounce(term => {this.videoSearch(term)}, 300);
      return (
        <div>
          <SearchBar onSearchTermChange={videoSearch}/>
          <VideoDetail video={this.state.selectedVideo}/>
          <VideoList 
            onVideoSelect={(selectedVideo) => {this.setState({selectedVideo})}}
            videos={this.state.videos}/>
        </div>
      );
    }
  }
  
  ReactDOM.render(<App />, document.querySelector('.container'));