<file_sep>import React, { Component } from 'react';
import './SearchBox.css';

class SearchBox extends Component { 
    render() {
        return (
            <div className="search-box">
                <form className="search-box__form" onSubmit={(e) => this.props.movieRequest(e)}>
                    <label className="search-box__form-label">
                        Искать фильм по названию:
                        <input
                            onChange = {(e) => this.props.changeMovies(e)}
                            name = 'nameMuvei'
                            value={this.props.searchMovies}
                            type="text"
                            className="search-box__form-input"
                            placeholder="Например, <NAME>"                          
                        />
                    </label>
                    <button
                        type="submit"
                        className="search-box__form-submit"
                        disabled={!this.props.searchMovies}
                    >
                        Искать
                    </button>
                </form>
            </div>
        );
    }
}
 
export default SearchBox;<file_sep>import React, { Component } from 'react';
import './Favorites.css';


class Favorites extends Component {
    state = {
        title: 'Новый список',
        movies: [
            { imdbID: 'tt0068646', title: 'The Godfather', year: 1972 }
        ]
    }

    render() { 
        return (
            <div className="favorites">
                <input value= {this.props.titleNewList} className="favorites__name" onChange = {(e) => this.props.getTitle(e)}/>
                <ul className="favorites__list">                
                    {this.props.selectedListMovies.map((item) => {
                        return <li className="listItem" key={item.imdbID}>{item.Title} ({item.Year})<button className="but" onClick = {() => this.props.deleteFilms(item.imdbID)}>❌</button></li>;
                    })}
                </ul>
                <button type="button" className="favorites__save" onClick = {this.props.requestGeneration}>Сохранить список</button>
            </div>
        );
    }
}
 
export default Favorites;<file_sep>export function GetListMovies(nameMovies) {
    return fetch(`http://www.omdbapi.com/?apikey=ce6c89d6&s=${nameMovies}`)
         .then(response => response.json())
         
 }
 
export function creatingMovieList(arr, title) {
     let info = {
         title: title,
         movies: arr
     }    
     return fetch('https://acb-api.algoritmika.org/api/movies/list', {
         method: 'POST',
         headers: { 'Content-type': 'application/json' },
         body: JSON.stringify(info)
     }).then(response => response.json());  
 }
 
export function getSelectMovieList(id){
     return fetch(`https://acb-api.algoritmika.org/api/movies/list/${id}`)
         .then(response => response.json())
 }
 
export function GetListIDMovies() {
     return fetch(`http://www.omdbapi.com/?apikey=ce6c89d6&i=tt3896198`)
          .then(response => response.json()).then(data => console.log(data))         
  }
 
 
export function renderingList(arr){
      let arrObj = arr.map((item) => fetch(`http://www.omdbapi.com/?apikey=ce6c89d6&i=${item}`).then(response => response.json()))
     return Promise.all(arrObj)
  }
  