AccountRegistrationModal.tsx 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. 'use client';
  2. import { X, User } from 'lucide-react';
  3. import { Account } from '@/types';
  4. interface AccountRegistrationModalProps {
  5. isOpen: boolean;
  6. onClose: () => void;
  7. account: Account | null;
  8. }
  9. export default function AccountRegistrationModal({
  10. isOpen,
  11. onClose,
  12. account,
  13. }: AccountRegistrationModalProps) {
  14. if (!isOpen || !account) return null;
  15. return (
  16. <div className="fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm p-4 animate-in fade-in zoom-in-95 duration-200">
  17. <div className="bg-white rounded-xl shadow-2xl w-full max-w-lg overflow-hidden">
  18. <div className="px-6 py-4 border-b border-slate-100 flex justify-between items-center bg-blue-50/50">
  19. <h3 className="font-bold text-lg text-blue-900 flex items-center gap-2">
  20. <User size={18} /> 注册信息
  21. </h3>
  22. <button onClick={onClose} className="text-slate-400 hover:text-slate-600">
  23. <X size={20} />
  24. </button>
  25. </div>
  26. <div className="p-6 space-y-4">
  27. <p className="text-sm text-slate-600 bg-blue-50 p-3 rounded-lg border border-blue-100">
  28. 账号: <span className="font-bold text-slate-900">{account.username}</span>
  29. </p>
  30. <div className="bg-slate-50 p-4 rounded-lg border border-slate-200">
  31. <pre className="text-xs font-mono text-slate-700 whitespace-pre-wrap overflow-x-auto">
  32. {JSON.stringify(account.extra_data || {}, null, 2)}
  33. </pre>
  34. </div>
  35. </div>
  36. <div className="px-6 py-4 bg-slate-50 flex justify-end gap-3 border-t">
  37. <button
  38. onClick={onClose}
  39. className="px-4 py-2 text-sm text-slate-600 hover:bg-slate-200 rounded-lg transition"
  40. >
  41. 关闭
  42. </button>
  43. </div>
  44. </div>
  45. </div>
  46. );
  47. }