import { createFileRoute, Link } from "@tanstack/react-router" import { useTranslation } from "react-i18next" import { ArrowLeft, Film, User } from "lucide-react" import { MovieCard } from "@/components/movie-card" import { EmptyState } from "@/components/empty-state" import { Skeleton } from "@/components/ui/skeleton" import { tmdbProfileUrl } from "@/lib/api/client" import { usePersonCredits } from "@/hooks/use-search" export const Route = createFileRoute("/_app/people/$id")({ component: PersonDetailPage, }) function PersonDetailPage() { const { t } = useTranslation() const { id } = Route.useParams() const { data, isPending } = usePersonCredits(id) if (isPending) return if (!data) return null const { person, cast, crew } = data return (
{t("common.back")}
{person.profile_path ? ( ) : (
)}

{person.name}

{person.known_for_department && (

{person.known_for_department}

)}
{cast.length > 0 && (

{t("movie.castCredits", { count: cast.length })}

{cast.map((c) => ( ))}
)} {crew.length > 0 && (

{t("movie.crewCredits", { count: crew.length })}

{crew.map((c) => ( ))}
)} {cast.length === 0 && crew.length === 0 && ( )}
) } function PersonSkeleton() { return (
{[1, 2, 3, 4].map((i) => ( ))}
) }