'use client';
import { X } from 'lucide-react';
import { createPortal } from 'react-dom';
interface EmailSettingsPanelProps {
isOpen: boolean;
mounted: boolean;
onClose: () => void;
userEmail: string;
onUserEmailChange: (value: string) => void;
emailNotifications: boolean;
onEmailNotificationsChange: (value: boolean) => void;
emailSettingsLoading: boolean;
emailSettingsSaving: boolean;
onSave: () => void;
statusMessage?: string;
statusType?: 'success' | 'error' | null;
}
export function EmailSettingsPanel({
isOpen,
mounted,
onClose,
userEmail,
onUserEmailChange,
emailNotifications,
onEmailNotificationsChange,
emailSettingsLoading,
emailSettingsSaving,
onSave,
statusMessage,
statusType,
}: EmailSettingsPanelProps) {
if (!isOpen || !mounted) return null;
return createPortal(
<>
e.preventDefault()}
onWheel={(e) => e.preventDefault()}
style={{ touchAction: 'none' }}
/>
e.stopPropagation()}
style={{ touchAction: 'auto' }}
>
邮件通知设置
{emailSettingsLoading ? (
) : (
onUserEmailChange(e.target.value)}
placeholder='输入您的邮箱地址'
disabled={emailSettingsSaving}
className='w-full px-3 py-2 border border-gray-300 dark:border-gray-600 rounded-lg bg-white dark:bg-gray-800 text-gray-900 dark:text-white text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed'
/>
接收收藏更新通知
当收藏的影片有更新时发送邮件通知
{statusMessage ? (
{statusMessage}
) : null}
)}
>,
document.body
);
}