Implemented the new react version of the frontend
This commit is contained in:
1 parent
236e6e06fb
commit
ffe7e52527
65 files changed
+5228
-177
No files matched your search
@@ -0,0 +1,94 @@
|
||||
import { useParams } from 'react-router-dom';
|
||||
import { usePerson } from '@/hooks/usePeople';
|
||||
import { useQuery } from '@tanstack/react-query';
|
||||
import { peopleApi } from '@/api/people';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar';
|
||||
import { Separator } from '@/components/ui/separator';
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
|
||||
import { EntryCard } from '@/components/entries/EntryCard';
|
||||
import { getProfileUrl, formatDate } from '@/lib/media-utils';
|
||||
|
||||
export function PersonDetailsPage() {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const personId = parseInt(id!, 10);
|
||||
const { data: person, isLoading } = usePerson(personId);
|
||||
|
||||
if (isLoading || !person) {
|
||||
return (
|
||||
<div className="space-y-6">
|
||||
<div className="flex gap-6">
|
||||
<Skeleton className="h-48 w-48 rounded-full" />
|
||||
<div className="flex-1 space-y-3">
|
||||
<Skeleton className="h-8 w-48" />
|
||||
<Skeleton className="h-4 w-32" />
|
||||
<Skeleton className="h-20 w-full" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="space-y-8">
|
||||
{/* Profile header */}
|
||||
<div className="flex gap-8">
|
||||
<Avatar className="h-48 w-48 shrink-0">
|
||||
<AvatarImage
|
||||
src={getProfileUrl(person.profile_path)}
|
||||
alt={person.name}
|
||||
/>
|
||||
<AvatarFallback className="text-3xl">
|
||||
{person.name
|
||||
.split(' ')
|
||||
.map((n: string) => n[0])
|
||||
.join('')}
|
||||
</AvatarFallback>
|
||||
</Avatar>
|
||||
|
||||
<div className="space-y-3">
|
||||
<h1 className="text-3xl font-bold">{person.name}</h1>
|
||||
<div className="flex flex-wrap items-center gap-3 text-sm text-muted-foreground">
|
||||
{person.known_for_department && (
|
||||
<span>{person.known_for_department}</span>
|
||||
)}
|
||||
{person.birthday && (
|
||||
<>
|
||||
<span>•</span>
|
||||
<span>Born: {formatDate(person.birthday)}</span>
|
||||
</>
|
||||
)}
|
||||
{person.deathday && (
|
||||
<>
|
||||
<span>•</span>
|
||||
<span>Died: {formatDate(person.deathday)}</span>
|
||||
</>
|
||||
)}
|
||||
{person.place_of_birth && (
|
||||
<>
|
||||
<span>•</span>
|
||||
<span>{person.place_of_birth}</span>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{person.biography && (
|
||||
<p className="text-sm text-muted-foreground leading-relaxed max-w-2xl line-clamp-6">
|
||||
{person.biography}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<Separator />
|
||||
|
||||
{/* Filmography placeholder */}
|
||||
<div className="space-y-4">
|
||||
<h2 className="text-xl font-semibold">Filmography</h2>
|
||||
<p className="text-sm text-muted-foreground">
|
||||
Filmography details will be loaded from credits associated with this person.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user