Files
sofa/app/(pages)/dashboard/_components/title-grid.tsx
T
jakeandClaude Opus 4.6 13d616a456 Replace motion.js entry animations with CSS to eliminate hydration delay
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>
2026-03-05 16:26:02 -05:00

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>
);
}