diff --git a/spa/src/locales/en.json b/spa/src/locales/en.json index cc7d097..3c03fc2 100644 --- a/spa/src/locales/en.json +++ b/spa/src/locales/en.json @@ -23,7 +23,9 @@ "run": "Run", "reviews": "{{count}} reviews", "films": "{{count}} films", - "filmsAvg": "{{count}} films, avg {{avg}}" + "filmsAvg": "{{count}} films, avg {{avg}}", + "more": "Show more", + "less": "Show less" }, "nav": { "home": "Home", diff --git a/spa/src/routes/_app/people.$id.tsx b/spa/src/routes/_app/people.$id.tsx index 1150e85..6736823 100644 --- a/spa/src/routes/_app/people.$id.tsx +++ b/spa/src/routes/_app/people.$id.tsx @@ -1,10 +1,15 @@ import { createFileRoute } from "@tanstack/react-router" +import { useState } from "react" import { useTranslation } from "react-i18next" -import { Calendar, ExternalLink, Film, Globe, MapPin, User } from "lucide-react" +import { Calendar, ChevronDown, ExternalLink, Film, Globe, MapPin, User } from "lucide-react" import { BackButton } from "@/components/back-button" import { MovieCard } from "@/components/movie-card" import { EmptyState } from "@/components/empty-state" +import { SwipeTabs } from "@/components/swipe-tabs" import { Badge } from "@/components/ui/badge" +import { Button } from "@/components/ui/button" +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" +import { Separator } from "@/components/ui/separator" import { Skeleton } from "@/components/ui/skeleton" import { tmdbProfileUrl } from "@/lib/api/client" import { usePersonCredits } from "@/hooks/use-search" @@ -27,152 +32,212 @@ function PersonDetailPage() { const { person, cast, crew } = data + const age = person.birthday + ? differenceInYears( + person.deathday ? parseISO(person.deathday) : new Date(), + parseISO(person.birthday), + ) + : null + + const creditTabs = [ + ...(cast.length > 0 ? [{ value: "cast", label: t("movie.cast") + ` (${cast.length})` }] : []), + ...(crew.length > 0 ? [{ value: "crew", label: t("movie.crew") + ` (${crew.length})` }] : []), + ] as const + return (
{person.known_for_department}
+
-
-
{person.biography}
- )} + {person.biography &&{t("person.alsoKnownAs")}
-+ {text} +
+ {isLong && ( + + )} +