'use client';

import React from 'react';
import { Loader2 } from 'lucide-react';

interface LoadingScreenProps {
  message?: string;
}

export function LoadingScreen({ message = '正在验证用户身份...' }: LoadingScreenProps) {
  return (
    <div className="min-h-screen flex items-center justify-center bg-gray-50">
      <div className="text-center">
        <div className="inline-flex items-center justify-center w-16 h-16 bg-green-100 rounded-full mb-4">
          <Loader2 className="w-8 h-8 text-green-600 animate-spin" />
        </div>
        <h2 className="text-xl font-semibold text-gray-900 mb-2">智慧农业生产管理系统</h2>
        <p className="text-gray-600">{message}</p>

        {/* 加载进度条 */}
        <div className="mt-6 w-64 h-2 bg-gray-200 rounded-full overflow-hidden">
          <div className="h-full bg-green-600 rounded-full animate-pulse" style={{ width: '60%' }}></div>
        </div>

        {/* 提示信息 */}
        <div className="mt-8 text-sm text-gray-500 max-w-md">
          <p>正在验证您的身份信息，请稍候...</p>
        </div>
      </div>
    </div>
  );
}