"use client"; import React from "react"; import { motion } from "motion/react"; import type { Variants } from "motion/react"; import { TRANSITIONS } from "@/lib/animation"; type SplitTextRevealProps = { text: string; className?: string; once?: boolean; wordClassName?: string; stagger?: number; }; export function SplitTextReveal({ text, className, once = true, wordClassName, stagger = 0.06, }: SplitTextRevealProps) { const words = text.trim().split(/\s+/); const container: Variants = { initial: {}, animate: { transition: { staggerChildren: stagger, }, }, }; const child: Variants = { initial: { opacity: 0, y: 8, filter: "blur(6px)" }, animate: { opacity: 1, y: 0, filter: "blur(0px)", transition: TRANSITIONS.base, }, }; return ( {words.map((w, i) => ( {w} {i < words.length - 1 ? " " : ""} ))} ); }