import Head from 'next/head' import { useRouter } from 'next/router' import { useState } from 'react' import useSWR from 'swr' import FilmCasts from '../../components/FilmCasts' import FilmGenres from '../../components/FilmGenres' import FilmHeading from '../../components/FilmHeading' import FilmImage from '../../components/FilmImage' import FilmInfo from '../../components/FilmInfo' import FilmRating from '../../components/FilmRating' import FilmResources from '../../components/FilmResources' import FilmSynopsis from '../../components/FilmSynopsis' import Loading from '../../components/Loading' import SearchBar from '../../components/SearchBar' import { fetcher, pathToSearchMovie, renderResults, sliceArray } from '../../utils' import YouTube from "react-youtube"; import TorrentList from '../../Common/TorrentList' import CardNormal from "../../components/CardNormal" import Heading from '../../components/Heading' export default function Movie() { const router = useRouter() const { id } = router?.query const { data: movie, error: movieError } = useSWR(`/api/movie/${id}`, fetcher) const[isTorrent,setisTorrent]=useState(false) const handleClose =()=>{ setisTorrent(true) } if (typeof (window) !== undefined) { console?.log("movie", movie) } if (movieError) return