import { useEffect, useState } from 'react' import movieApi from '../apis/movie.api.js' const Video = ({movieId}) => { const [videoUrls, setVideoUrls] = useState([]) useEffect(() => { getVideos() }, []) async function getVideos() { try { const data = await movieApi.getVideosfromTM(movieId) setVideoUrls(data) } catch (error) { console.log(error) } } return (
{videoUrls.length > 0 ? videoUrls.map(el => (

{el.name}

)) :
예고편 정보가 존재하지 않습니다.
}
) } export default Video