import React from "react"; import PropTypes from "prop-types"; import { List } from "immutable"; import { useDispatch } from "react-redux"; import { getMovieDetails } from "../../actions/movies"; import { TorrentsButton } from "../buttons/torrents"; export const MovieTorrentsButton = ({ torrents, imdbId, title, searching }) => { const dispatch = useDispatch(); return ( dispatch(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, };