import { Children, type ReactNode } from "react"; import { cn } from "@/lib/utils"; export interface MarqueeProps { children: ReactNode; direction?: "left" | "right" | "up" | "down"; speed?: number; pauseOnHover?: boolean; gap?: string; className?: string; fade?: boolean; } export function Marquee({ children, direction = "left", speed = 30, pauseOnHover = true, gap = "1rem", className, fade = true, }: MarqueeProps) { const vertical = direction === "up" || direction === "down"; const reverse = direction === "right" || direction === "down"; const items = Children.toArray(children); return (
{[0, 1].map((dup) => (
{items.map((child, i) => (
{child}
))}
))}
); }