| 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 | useEffect(() => |
| 11 | const intervalId = |
| 12 | () => setIndex( |
| 13 | 3000 // every 3 seconds |
| 14 | ); |
| 15 | return () => |
| 16 | }, []); |
| 17 | |
| 18 | return ( |
| 19 | <span className="ml-2 text-white |
| 20 | <TextTransition inline springConfig |
| 21 | {TEXTS[index % |
| 22 | </TextTransition> |
| 23 | s. |
| 24 | </span> |
| 25 | ); |
| 26 | } |