"use client" import { useEffect, useRef } from "react" import { motion } from "framer-motion" import { cn } from "@/lib/utils" interface AnimatedGradientTextProps { text: string className?: string gradient?: string animate?: boolean delay?: number } export default function AnimatedGradientText({ text, className, gradient = "from-blue-600 via-purple-600 to-blue-600", animate = true, delay = 0, }: AnimatedGradientTextProps) { const textRef = useRef(null) useEffect(() => { if (!animate || !textRef.current) return const loadGsap = async () => { const { gsap } = await import("gsap") gsap.to(textRef.current, { backgroundPosition: "-200% center", ease: "linear", duration: 15, repeat: -1, delay, }) } loadGsap() }, [animate, delay]) return ( {text} ) }