text: import React, { Component } from "react";
  import SearchForm from "./SearchForm";
  import ResultList from "./ResultList";
  import API from "../utils/API";
  
  class SearchResultContainer extends Component {
    state = {
      search: "",
      results: []
    };
  
    // When this component mounts, search the Giphy API for pictures of kittens
    componentDidMount() {
      this.searchUser()
    }
  
    searchUser = () => {
      API.search()
        .then(res => {
          console.log(res.data)
          this.setState({ results: res.data.results })
        })
        .catch(err => console.log(err));
    };
  
    handleInputChange = event => {
      const name = event.target.name;
      const value = event.target.value;
      this.setState({
        [name]: value
      }, () => console.log(this.state));
  
    };
  
    // When the form is submitted, search the Giphy API for `this.state.search`
    handleFormSubmit = event => {
      event.preventDefault();
      this.searchGiphy(this.state.search);
    };
  
    render() {
      return (
        <div>
          <SearchForm
            search={this.state.search}
            handleFormSubmit={this.handleFormSubmit}
            handleInputChange={this.handleInputChange}
          />
          <ResultList results={this.state.results} searchtext={
            this.state.search
          } />
        </div>
      );
    }
  }
  
  export default SearchResultContainer;
  