import { useState, useEffect } from "react" import movieApi from '../../apis/movie.api.js' const BoxOffice = () => { const [TMDB_TopRated_Data, setTMDB_TopRated_Data] = useState([]) useEffect(() => { getTMDB_TopRated() }, []) async function getTMDB_TopRated() { const category = "popular" try { const data = await movieApi.getListByCategoryfromDB(category) console.log(data) setTMDB_TopRated_Data([...data]) } catch (error) { console.log(error) } } return (
{/*
{TMDB_TopRated_Data.length>0 ? TMDB_TopRated_Data.map((movie, index) => {
{console.log(movie.poster_path)} Movie Poster
}) :
{console.log("스틸컷 불러오기 오류")} 등록된 스틸컷이 없습니다.
}
*/}
) } export default BoxOffice