"use client" import { useRef } from "react" import { ChevronLeft, ChevronRight } from "lucide-react" import { GameCard } from "./game-card" import { cn } from "@/lib/utils" interface GameRowProps { title: string games: any[] showSeeMore?: boolean rows?: 1 | 2 | 3 } export function GameRow({ title, games, showSeeMore = true, rows = 1 }: GameRowProps) { const scrollRef = useRef(null) const scroll = (direction: "left" | "right") => { if (scrollRef.current) { const scrollAmount = direction === "left" ? -600 : 600 scrollRef.current.scrollBy({ left: scrollAmount, behavior: "smooth" }) } } // Chunk games into rows if rows > 1 const renderGames = () => { if (rows === 1) { return games.map((game, idx) => (
)) } // For multi-row, we can use a grid with horizontal scroll on the container // or wrap items. The requirement "3*6 horizontally scrollable" suggests // a grid that moves as a block or multi-row horizontal layout. return (
{games.map((game, idx) => (
))}
) } return (

{title}

{showSeeMore && ( )}
{rows === 1 ? (
{renderGames()}
) : ( renderGames() )}
) }