import React from "react"; import PropTypes from "prop-types"; import { List } from "immutable"; import { connect } from "react-redux"; import { getMovieDetails } from "../../actions/movies"; import { TorrentsButton } from "../buttons/torrents"; const movieTorrentsButton = ({ torrents, imdbId, title, searching, getMovieDetails }) => ( getMovieDetails(imdbId)} url={`#/torrents/search/movies/${encodeURI(title)}`} /> ); movieTorrentsButton.propTypes = { torrents: PropTypes.instanceOf(List), imdbId: PropTypes.string, title: PropTypes.string, searching: PropTypes.bool, getMovieDetails: PropTypes.func }; export const MovieTorrentsButton = connect(null, { getMovieDetails })( movieTorrentsButton );