import React from "react"; import "./SearchItem.scss"; import { withRouter } from "react-router"; import { IMAGE_BASE_URL, POSTER_SIZE } from "../../Config/config"; import imdb from "../../Assets/imdb.png"; import star from "../../Assets/star.png"; import { FixString } from "../../Utils/FixString"; import AddToList from "../AddToList/AddToList"; const SearchItem = ({ item, history, ListItems }) => { const { id, title, poster_path, vote_average, name } = item; var titlePath = title ? FixString(title) : null; var namePath = name ? FixString(name) : null; return (
imdb {vote_average}/ 10 imdb
{ return title ? history.push({ pathname: `/movies/${titlePath}`, state: { id } }) : history.push({ pathname: `/tvshows/${namePath}`, state: { id } }); }} > movie

{title}

{name}

); }; export default withRouter(SearchItem);