import axios from "axios" import baseUrl from '../../utils/baseUrl' import React, { useState,useEffect } from "react" import styles from "./box-office.module.scss" const BoxOffice = () => { const [TMDB_TopRated_Data, setTMDB_TopRated_Data] = useState() useEffect(() => { getTMDB_TopRated() let items = document.querySelectorAll('.carousel .carousel-item') console.log("item", items) items.forEach((el) => { const minPerSlide = 4 let next = el.nextElementSibling for (let i = 1; i < minPerSlide; i++) { if (!next) { next = items[0] } let cloneChild = next.cloneNode(true) el.appendChild(cloneChild.children[0]) next = next.nextElementSibling } }) }, []) async function getTMDB_TopRated() { try { const response = await axios.get(`${baseUrl}/api/movie`) console.log(response.data) } catch (error) { } } async function name() { } return (