import React from 'react' import DownloadButton from '../buttons/download' import TorrentsButton from './torrents' import ActionsButton from './actions' import ListPosters from '../list/posters' import ListDetails from '../list/details' function MovieButtons(props) { const imdb_link = `http://www.imdb.com/title/${props.movie.imdb_id}`; const hasMovie = (props.movie.polochon_url !== ""); return (
{props.movie.torrents && } IMDB
); } export default class MovieList extends React.Component { constructor(props) { super(props); } componentWillMount() { if (this.props.moviesUrl) { this.props.fetchMovies(this.props.moviesUrl); } } render() { const movies = this.props.movieStore.movies; const selectedMovieId = this.props.movieStore.selectedImdbId; let index = movies.map((el) => el.imdb_id).indexOf(selectedMovieId); if (index === -1) { index = 0; } const selectedMovie = movies[index]; return (
{selectedMovie && }
); } }