import { useState } from 'react'; import { Link } from 'react-router-dom'; import { ChevronRight } from 'lucide-react'; import { Button } from '@/components/ui/button'; import { Tabs, TabsList, TabsTrigger } from '@/components/ui/tabs'; import { EntryCard, EntryCardSkeleton } from './EntryCard'; import type { TmdbEntry } from '@/types'; interface TrendingGridProps { title: string; movieEntries: TmdbEntry[]; tvEntries: TmdbEntry[]; isLoading?: boolean; moreLink: string; } export function TrendingGrid({ title, movieEntries, tvEntries, isLoading, moreLink, }: TrendingGridProps) { const [activeTab, setActiveTab] = useState<'movie' | 'tv'>('movie'); const entries = activeTab === 'movie' ? movieEntries : tvEntries; // Limit to 2 rows (14 items for a 7-column grid) const displayEntries = entries.slice(0, 14); return (

{title}

setActiveTab(v as 'movie' | 'tv')} > Movies TV Series
{isLoading ? (
{Array.from({ length: 14 }).map((_, i) => ( ))}
) : (
{displayEntries.map((tmdbEntry) => ( ))}
)}
); }