"use client"; import { memo } from "react"; import Marquee from "react-fast-marquee"; import { cls, shouldUseInvertedText } from "@/lib/utils"; import { useTheme } from "@/providers/themeProvider/ThemeProvider"; import type { LucideIcon } from "lucide-react"; import type { InvertedBackground } from "@/providers/themeProvider/config/constants"; type BentoMarqueeProps = { centerIcon: LucideIcon; useInvertedBackground: InvertedBackground; className?: string; } & ( | { variant: "text"; texts: string[] } | { variant: "icon"; icons: LucideIcon[] } ); const BentoMarquee = (props: BentoMarqueeProps) => { const { centerIcon, useInvertedBackground, className = "" } = props; const theme = useTheme(); const shouldUseLightText = shouldUseInvertedText(useInvertedBackground, theme.cardStyle); const CenterIcon = centerIcon; const items = props.variant === "text" ? [...props.texts, ...props.texts] : [...props.icons, ...props.icons]; return (
{Array.from({ length: 10 }).map((_, rowIndex) => ( {items.map((item, itemIndex) => (
{props.variant === "text" ? (

{item as string}

) : ( (() => { const Icon = item as LucideIcon; return ; })() )}
))}
))}
); }; BentoMarquee.displayName = "BentoMarquee"; export default memo(BentoMarquee);