"use server"; import { SEARCH } from "../../../../utils/movie_urls"; import PreFetchMovieInfo from "./cacher"; import Image from "next/image"; import Link from "next/link"; import styles from "../styles/search.module.css"; const SearchResults = async (title) => { const data = await get_search_results(title); PreFetchMovieInfo(data); if (data.results.length > 0) { return (
{item.title || item.original_title}
No results found!
; } }; const get_search_results = async (title) => { const res = await fetch(SEARCH + title, { next: { revalidate: 21600 } }); const data = await res.json(); return data; }; export default SearchResults;