| 1 | "use client"; |
| 2 | |
| 3 | import { useEffect, useState |
| 4 | import TextTransition from "./text |
| 5 | import { config } |
| 6 | const TEXTS = [ |
| 7 | |
| 8 | export default function Transition |
| 9 | const [index, |
| 10 | |
| 11 | useEffect(() => |
| 12 | const intervalId = |
| 13 | () => setIndex( |
| 14 | 3000 // every 3 seconds |
| 15 | ); |
| 16 | return () => |
| 17 | }, []); |
| 18 | |
| 19 | return ( |
| 20 | <span className="ml-2 text-white |
| 21 | <TextTransition inline springConfig |
| 22 | {TEXTS[index % |
| 23 | </TextTransition> |
| 24 | s. |
| 25 | </span> |
| 26 | ); |
| 27 | } |