import { motion } from 'framer-motion';

/**
 * Loader 组件
 * 全屏加载动画，包含旋转圆环和文字
 * @param {Object} props
 * @param {string} props.text - 加载文字
 */
const Loader = ({ text = '载入生命序列...' }) => {
  return (
    <motion.div
      initial={{ opacity: 0 }}
      animate={{ opacity: 1 }}
      exit={{ opacity: 0 }}
      transition={{ duration: 0.4 }}
      className="fixed inset-0 flex flex-col items-center justify-center z-[200] bg-[#0a0c10]"
    >
      {/* 旋转圆环 */}
      <div className="w-16 h-16 border-2 border-orange-200/20 border-t-orange-200 rounded-full animate-spin mb-4" />
      
      {/* 加载文字 */}
      <p className="text-xs tracking-[0.3em] text-white/40 uppercase">
        {text}
      </p>
    </motion.div>
  );
};

export default Loader;
