'use client'; import React, { useMemo, type JSX } from 'react'; import { motion } from 'motion/react'; import { cn } from '@/lib/utils'; interface TextShimmerProps { children: string; as?: React.ElementType; className?: string; duration?: number; spread?: number; } export function TextShimmer({ children, as: Component = 'p', className, duration = 2, spread = 2, }: TextShimmerProps) { const MotionComponent = motion.create( Component as keyof JSX.IntrinsicElements ); const dynamicSpread = useMemo(() => { return children.length * spread; }, [children, spread]); return ( {children} ); }