content: import React from 'react';
  
  class Header extends React.Component{
      constructor(props){
          super(props);
          this.state = {
              value: ''
          }
      }
      handleChange = (e) =>{
          this.setState({
              value: e.target.value
          })
      }
      handleKeyDown = (e) => {
          if(e.keyCode != 13 || !e.target.value)return;
          this.props.onHeaderKeyDown(e.target.value);
          this.state.value = '';
      }
      handleCheck = (e) => {
          this.props.onHeaderCheck(e.target.checked);
      }
      render(){
          return(
              <header>
                  <h2>Todos</h2>
                  <p>
                      <input type="text"
                          onKeyDown={this.handleKeyDown}
                          onChange={this.handleChange}
                          value={this.state.value}
                          placeholder="What needs to be done?"
                          />
                  </p>
                  <label>
                      <input type="checkbox" onChange={this.handleCheck} checked={this.props.checked} />
                      <span>Mark all as complete</span>
                  </label>
              </header>
          )
      }
  }
  
  export default Header;
  