import Image from "next/image"; import Link from "next/link"; import { ArrowLeft } from "lucide-react"; import { getPosterUrl, getUsCertification, type TmdbMovieDetails } from "@/lib/tmdb"; export function MovieHeader({ movie, showBack = true, }: { movie: TmdbMovieDetails; showBack?: boolean; }) { const poster = getPosterUrl(movie.poster_path, "w500"); const year = movie.release_date?.slice(0, 4); const certification = getUsCertification(movie); return (
{showBack && ( Back to search )}
{poster ? ( {movie.title} ) : (
No poster
)}

{movie.title}

{[year, movie.runtime ? `${movie.runtime} min` : null] .filter(Boolean) .join(" ยท ")}

{certification ? ( {certification} ) : null} {movie.genres.map((genre) => ( {genre.name} ))}
{movie.overview ? (

{movie.overview}

) : null}
); }