// this will show a loading animation with text below // if you pass array it will say it one by one giving user clear instruction on what's happening import { useEffect, useState } from "react"; import { AnimatePresence, motion } from "framer-motion"; import { twMerge } from "tailwind-merge"; import { Lottie } from "../Lottie"; type Props = { text?: string | string[]; frequency?: number; className?: string; }; export const ContentLoader = ({ text, frequency = 2000, className }: Props) => { const [pos, setPos] = useState(0); const isTextArray = Array.isArray(text); useEffect(() => { let interval: NodeJS.Timeout; if (isTextArray) { interval = setInterval(() => { setPos((state) => (state + 1) % text.length); }, frequency); } return () => clearInterval(interval); }, []); return (