import React, { useState } from "react"; import useFetch from "../hooks/useFetch"; import { Pagination } from "@mui/material"; import { ClipLoader } from "react-spinners"; import Card from "../components/Card"; const HomePage = () => { const url = import.meta.env.VITE_BASE_URL; const [inputValue, setInputValue] = useState(""); const [searchValue, setSearchValue] = useState(""); const [page, setPage] = useState(1); const { data, loading, error } = useFetch( url + "&s=" + searchValue + "&page=" + page ); console.log(page); const handlePageChange = (e) => { setPage(e?.target?.textContent); }; const handleSearch = (event) => { event.preventDefault(); setSearchValue(inputValue); }; return (
setInputValue(event?.target?.value) } className="p-1 text-quadnary bg-primary rounded outline-none border border-ternary" />
{data?.Search?.length > 0 && (
{data?.Search?.map((movie) => ( ))}
)}
); }; export default HomePage;