import { useState, useEffect } from 'react' import movieApi from "../apis/movie.api.js" import MovieCard from "./MovieCard/index.js" import catchErrors from '../utils/catchErrors.js' const MovieComming = () => { const [TMDB_UpComming_Data, setTMDB_UpComming_Data] = useState([]) const [error, setError] = useState("") const category = "upcoming" useEffect(() => { getTMDB_UpComming() }, []) async function getTMDB_UpComming() { try { setError("") const response = await movieApi.getfromTM(category) setTMDB_UpComming_Data([...response]) } catch (error) { catchErrors(error, setError) } } return ( <> {TMDB_UpComming_Data.length !== 0 ?
:

영화정보를 로딩할 수 없습니다.

} ) } export default MovieComming