canape/frontend/js/components/movies/torrentsButton.js
Grégoire Delattre bcadc48d5a Launch prettier with the --fix option
They've changed their default settings, this changes a lot of stuff in
our code base.
2020-04-01 17:55:34 +02:00

34 lines
819 B
JavaScript

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,
}) => (
<TorrentsButton
torrents={torrents}
searching={searching}
search={() => 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
);