import type { ChangeEvent } from 'react'; import { Button } from './ui/Button'; import { Field } from './ui/Field'; interface LoginModalProps { open: boolean; onClose: () => void; appleId: string; password: string; busyLoginSign: boolean; canSubmit: boolean; error?: string | null; onAppleIdChange: (value: string) => void; onAppleIdBlur: () => void; onPasswordChange: (value: string) => void; onSubmit: () => void; } export function LoginModal({ open, onClose, appleId, password, busyLoginSign, canSubmit, error, onAppleIdChange, onAppleIdBlur, onPasswordChange, onSubmit, }: LoginModalProps) { if (!open) return null; return (

Add Account

) => onAppleIdChange(e.target.value)} onBlur={onAppleIdBlur} /> ) => onPasswordChange(e.target.value)} onKeyDown={(e) => { if (e.key === 'Enter' && canSubmit && !busyLoginSign) { e.preventDefault(); onSubmit(); } }} />

Your credentials are stored locally in this browser and are sent directly to Apple.

Verify that you trust the server hosting this page. A compromised server can intercept your credentials.

{error && (

{error}

)}
); }