import { HeroMovie } from "@/components/molecules/HeroMovie";
import { MovieCast } from "@/components/molecules/MovieCast";
import { SimilarMovies } from "@/components/molecules/SimilarMovies";
import { RecommendedMovies } from "@/components/molecules/RecommendedMovies";
import { MovieGallery } from "@/components/molecules/MovieGallery";
import { TMDB } from "@/lib/tmdb";

// Main movie details component.
export default async function Page({
  params,
}: {
  params: Promise<{ id: string }>;
}) {
  const movieId = Number((await params).id);

  const movieDetails = await TMDB.getMovieDetailsRich(movieId);

  return (
    <div className="min-h-screen mt-16">
      <HeroMovie movieDetails={movieDetails} />
      <MovieCast movieDetails={movieDetails} />
      <MovieGallery
        images={movieDetails.images}
        movieTitle={movieDetails.title}
      />
      <SimilarMovies movies={movieDetails.similar} />
      <RecommendedMovies movies={movieDetails.recommendations} />
    </div>
  );
}
