Files
movie-advisor/components/Person/components/Skeleton/index.tsx
T
nerandClaude Opus 5 3dc2ebfe53 feat: replace the starring page with a person page
A credit now opens /person/{id}: portrait, name, department, life dates and
birthplace, the biography, and the full filmography ranked by vote count.
One request carries all of it — combined_credits rides along on the person
call — so the discover based starring query and its with_people filter go.

The biography fills whatever height the portrait leaves and fades where it
is cut, with the whole text in a tooltip on hover; a phone has no height to
respect there, so it simply runs on.

Route level and query level skeletons stand in while it loads, built from
the shadcn primitive.

Development server side fetches go over the loopback rather than SITE_URL,
which is a LAN address meant for other devices: once that address moves the
fetch hangs until undici times out, ten seconds per navigation.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-04 22:09:33 +03:00

53 lines
1.6 KiB
TypeScript

import { FC } from 'react';
import { Skeleton } from '@/components/ui/skeleton';
import { cn } from '@/lib/utils';
const PARAGRAPHS = [
['w-full', 'w-full', 'w-10/12'],
['w-full', 'w-full', 'w-full', 'w-4/5'],
['w-full', 'w-full', 'w-3/4'],
['w-full', 'w-2/3']
];
const POSTERS = Array.from({ length: 8 }, (_, index) => index);
const PersonSkeleton: FC = () => (
<div className='flex flex-1 flex-col'>
<div className='flex flex-col gap-2 md:flex-row'>
<Skeleton className='card-aspect-ratio static-aspect-ratio mx-auto rounded-lg' />
<div className='flex grow flex-col'>
<Skeleton className='mb-4 h-9 w-72 max-w-full' />
<div className='mb-4 flex w-full flex-wrap gap-5'>
<Skeleton className='h-5 w-20' />
<Skeleton className='h-5 w-28' />
<Skeleton className='h-5 w-56 max-w-full' />
</div>
<div className='flex grow flex-col gap-5 overflow-hidden md:min-h-0'>
{PARAGRAPHS.map((lines, paragraph) => (
<div key={paragraph} className='flex shrink-0 flex-col gap-2'>
{lines.map((width, line) => (
<Skeleton key={line} className={cn('h-4', width)} />
))}
</div>
))}
</div>
</div>
</div>
<div className='mt-5'>
<Skeleton className='mb-3 h-7 w-36' />
<div className='flex flex-wrap justify-center gap-2'>
{POSTERS.map((index) => (
<Skeleton key={index} className={cn('card-aspect-ratio rounded-lg', { 'hidden md:block': index >= 2 })} />
))}
</div>
</div>
</div>
);
export default PersonSkeleton;