"use client" import { type CSSProperties, type ElementType, memo, useMemo } from "react" import { cn } from "@/lib/utils" export type TextShimmerProps = { children: string as?: ElementType className?: string duration?: number spread?: number } const ShimmerComponent = ({ children, as: Component = "p", className, duration = 2, spread = 2, }: TextShimmerProps) => { const dynamicSpread = useMemo( () => (children?.length ?? 0) * spread, [children, spread], ) return ( {children} ) } export const Shimmer = memo(ShimmerComponent)