import { useState, useEffect } from 'react' import { Link } from 'react-router-dom' import movieApi from '../apis/movie.api.js' import TicketingMovie from "../components/TicketingMovie/TicketingMovie.js" import TicketingTheater from "../components/TicketingTheater/TicketingTheater.js" import TicketingTimeTable from "../components/TicketingTimeTable/TicketingTimeTable.js" const TicketingPage = ({ location }) => { const [ticketInfo, setTicketInfo] = useState({ ...location.state, theater:"", selectedCinemaNum: 3, time: "2021/07/21 10:00" }) const [theaterInfo, setTheaterInfo] = useState({ theater: ["Butter Studio 조치원"], cinemaNum: [1, 2, 3, 4] }) const [movieInfo, setMovieInfo] = useState() useEffect(() => { getMovieInfo() }, [ticketInfo]) async function getMovieInfo() { try { const data = await movieApi.getMovieInfofromTM(ticketInfo.movieId) setMovieInfo(data) } catch (error) { console.log(error) } } return (