mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 03:55:38 -04:00
Motion's initial="hidden" rendered opacity:0 in server HTML, making content invisible until JS hydrated — causing a multi-second blank gap after skeleton disappearance. Replaced with CSS @keyframes stagger animation that plays immediately from SSR. Also made color extraction fire-and-forget, merged duplicate stats queries, and removed redundant dashboard loading.tsx. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
38 lines
905 B
TypeScript
38 lines
905 B
TypeScript
"use client";
|
|
|
|
import { TitleCard } from "@/components/title-card";
|
|
|
|
interface TitleGridItem {
|
|
id: string;
|
|
tmdbId: number;
|
|
type: string;
|
|
title: string;
|
|
posterPath: string | null;
|
|
releaseDate?: string | null;
|
|
voteAverage?: number | null;
|
|
}
|
|
|
|
export function TitleGrid({ items }: { items: TitleGridItem[] }) {
|
|
return (
|
|
<div className="grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5">
|
|
{items.map((t, i) => (
|
|
<div
|
|
key={t.id}
|
|
className="animate-stagger-item"
|
|
style={{ "--stagger-index": i } as React.CSSProperties}
|
|
>
|
|
<TitleCard
|
|
id={t.id}
|
|
tmdbId={t.tmdbId}
|
|
type={t.type}
|
|
title={t.title}
|
|
posterPath={t.posterPath}
|
|
releaseDate={t.releaseDate}
|
|
voteAverage={t.voteAverage}
|
|
/>
|
|
</div>
|
|
))}
|
|
</div>
|
|
);
|
|
}
|