import { useState, useEffect } from 'react' import movieApi from '../../apis/movie.api' import catchErrors from '../../utils/catchErrors' import styles from "./ticketingMovie.module.scss" const TicketingMovie = ({ ticketInfo, setTicketInfo }) => { const [movieList, setMovieList] = useState([]) const [error, setError] = useState() useEffect(() => { getMovieList() }, []) async function getMovieList() { try { const response = await movieApi.getListByCategoryfromDB() setMovieList(response) } catch (error) { catchErrors(error, setError) } } function handleClick(event) { setTicketInfo({ ...ticketInfo, movieId: event.target.name }) } return (