import { useState, useEffect } from "react" import { Link } from 'react-router-dom' import styles from './movie-card.module.scss' const MovieCard = ({ list }) => { const [movieList, setMovieList] = useState(list) useEffect(() => { setMovieList(list) }, [list]) return ( <> {movieList.map(movie => (
Movie Poster
{movie.overview}
{movie.adult? :<>}
{movie.title}

예매율: {Math.round((movie.ticket_sales/(movie.totalReservationRate.totalReservationRate||1))*100)}% | {movie.runtime}분

{movie.release_date} 개봉

))} ) } export default MovieCard