import movies from "../../../../movies.json"; // import JSON dataset containing all movies export const dynamicParams = true; // allow dynamic parameters, allows pages to be generated for any slug export default async function page({params}: {params: any}) { const { slug } = await params; // extract movie slug from URL const movie = movies.find((m) => m.slug?.trim() === slug?.trim()); // search movies array for movie whose slug matches if (!movie) return

Movie not found

; return (
{movie.poster && ( {movie.title} )}

{movie.title}

{movie.genre} {movie.releaseDate}

{movie.plot}

Directed By: {movie.director}
Featuring: {movie.cast}
); }