Ssr All Movies Categories -
export default function CategoryPage( movies, category ) return ( <div> <h1>category Movies</h1> <div className="movie-grid"> movies.map(movie => ( <div key=movie.id> <img src=movie.poster alt=movie.title /> <h3>movie.title</h3> <p>Rating: movie.rating</p> </div> )) </div> </div> );
import Head from 'next/head'; <Head> <title>category Movies - Watch Online</title> <meta name="description" content= Best $category movies: action-packed, top-rated, and new releases. /> </Head> Step 4: Handle Category Not Found if (!movies.length) return <div>No movies found in category category.</div>; ssr all movies categories
export async function getServerSideProps(context) const category = context.params; const res = await fetch(`https://api.example.com/movies?genre=$category`); const movies = await res.json(); return props: movies, category , ; export default function CategoryPage( movies
