"use client";
import { motion } from "framer-motion";
import { TextShimmerWave } from "@/components/magicui/text-shimmer-wave";

export default function Loader({ state }: { state: number }) {
  return (
    <>
      {state === 1 && (
        <motion.div
          initial={{ y: -25, opacity: 0 }}
          whileInView={{ y: 0, opacity: 1 }}
          viewport={{ once: true }}
          transition={{ duration: 0.25, delay: 0.6 }}
          className="flex justify-start"
        >
          <TextShimmerWave
            className="text-center"
            duration={1}
            spread={1}
            zDistance={1}
            scaleDistance={1.1}
            rotateYDistance={20}
          >
            Searching Internet and Databases...
          </TextShimmerWave>
        </motion.div>
      )}

      {state === 2 && (
        <div className="flex justify-start">
          <TextShimmerWave
            className="text-center"
            duration={1}
            spread={1}
            zDistance={1}
            scaleDistance={1.1}
            rotateYDistance={20}
          >
            Compiling the Best Results...
          </TextShimmerWave>
        </div>
      )}
    </>
  );
}
