'use client'; import { Bell, KeyRound, Monitor, X } from 'lucide-react'; import { createPortal } from 'react-dom'; interface PersonalCenterPanelProps { isOpen: boolean; mounted: boolean; onClose: () => void; username: string; roleText: string; showRoleBadge: boolean; avatarText: string; roleBadgeClassName: string; showDeviceManagement: boolean; showChangePassword: boolean; onOpenEmailSettings: () => void; onOpenDeviceManagement: () => void; onOpenChangePassword: () => void; } export function PersonalCenterPanel({ isOpen, mounted, onClose, username, roleText, showRoleBadge, avatarText, roleBadgeClassName, showDeviceManagement, showChangePassword, onOpenEmailSettings, onOpenDeviceManagement, onOpenChangePassword, }: PersonalCenterPanelProps) { if (!isOpen || !mounted) return null; return createPortal( <>
{ e.preventDefault(); }} onWheel={(e) => { e.preventDefault(); }} style={{ touchAction: 'none' }} />
{ e.stopPropagation(); }} style={{ touchAction: 'auto' }} >
{avatarText}
{showRoleBadge && ( {roleText} )}

{username}

{showDeviceManagement && ( )} {showChangePassword && ( )}
, document.body ); }