"use client"; import { HTMLAttributes, useEffect, useRef } from "react"; import { cn } from "@/utils/cn"; import { setIntervalOnVisible } from "@/utils/set-timeout-on-visible"; import data from "./core-flame.json"; export function CoreFlame(attrs: HTMLAttributes) { const ref = useRef(null); const wrapperRef = useRef(null); useEffect(() => { let index = 0; const interval = setIntervalOnVisible({ element: wrapperRef.current, callback: () => { index++; if (index >= data.length) index = 0; const newStr = data[index]; ref.current!.innerHTML = newStr; }, interval: 80, }); return () => interval?.(); }, []); return ( <>
); } // Export default for backward compatibility export default CoreFlame;