Skip to content

Commit

Permalink
add MoviesList logic
Browse files Browse the repository at this point in the history
  • Loading branch information
konstantin-it-lysenko committed Dec 18, 2023
1 parent 443a451 commit 02882e4
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions src/components/MoviesList/MoviesList.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import defaultPoster from '../../images/default-poster.jpeg';
import { List, Item, MovieLink, MovieTitle } from './MoviesList.styled';

const MoviesList = ({ movies }) => {
return (
<List>
{movies.map(({ id, original_title, poster_path }) => {
return (
<Item key={id}>
<MovieLink to={`/movies/${id}`}>
<img
src={
poster_path
? `https://image.tmdb.org/t/p/w500${poster_path}`
: defaultPoster
}
alt={original_title}
/>
<MovieTitle>{original_title}</MovieTitle>
</MovieLink>
</Item>
);
})}
</List>
);
};

export default MoviesList;

0 comments on commit 02882e4

Please sign in to comment.