import React,{useState, useEffect} from 'react' import axios from 'axios' import baseUrl from '../../utils/baseUrl' import { Link } from 'react-router-dom'; import styles from "./movieChart.module.scss" const MovieChart = () => { const [TMDB_TopRated_Data, setTMDB_TopRated_Data] = useState() useEffect(() => { getTMDB_TopRated() }, []) async function getTMDB_TopRated() { try { const response = await axios.get(`${baseUrl}/api/movie`) console.log(response.data) setTMDB_TopRated_Data([...response.data.results]) } catch (error) { } } return (
{console.log(TMDB_TopRated_Data)} {TMDB_TopRated_Data ? TMDB_TopRated_Data.map(movie => (
Movie Poster
{movie.overview}
{movie.title}

예매율: {movie.ticket_sales}% | {movie.runtime}분

{movie.release_date} 개봉

)) :
영화정보를 로딩할 수 없습니다.
}
) } export default MovieChart