import { motion } from "framer-motion"; import React from "react"; import UserCardSkeleton from "./UserCardSkeleton"; const CARD_COLORS = ["#266678", "#cb7c7a", " #36a18b", "#cda35f", "#747474"]; const CARD_OFFSET = 10; const SCALE_FACTOR = 0.06; const moveArrayItem = (arr: string[], fromIndex: number, toIndex: number) => { const newArray = [...arr]; const [movedItem] = newArray.splice(fromIndex, 1); newArray.splice(toIndex, 0, movedItem); return newArray; }; const LoadingCards = () => { const [cards, setCards] = React.useState(CARD_COLORS); const moveToEnd = (from: number) => { setCards((prevCards) => moveArrayItem(prevCards, from, prevCards.length - 1), ); }; // biome-ignore lint/correctness/useExhaustiveDependencies: React.useEffect(() => { const interval = setInterval(() => { moveToEnd(0); }, 3000); return () => clearInterval(interval); }, []); return (
); }; export default React.memo(LoadingCards);