import { FormEvent, useState } from 'react' import { LockKeyhole } from 'lucide-react' export type PinOptions = { title?: string message?: string profileName: string } export function PinDialog({ options, onClose, }: { options: PinOptions onClose: (value: string | null) => void }) { const [pin, setPin] = useState('') const onSubmit = (event: FormEvent) => { event.preventDefault() const trimmed = pin.trim() if (!trimmed) return onClose(trimmed) } return (
onClose(null)} >
event.stopPropagation()} >

{options.title || '需要 PIN 验证'}

{options.message || `切换到「${options.profileName}」前请输入 PIN。`}

setPin(event.target.value)} className="mt-4 w-full rounded-2xl border border-gray-200 bg-gray-50 px-4 py-3 text-center text-lg font-bold tracking-[0.35em] text-ink-600 outline-none transition focus:border-brand-500 focus:bg-white focus:ring-4 focus:ring-brand-100/40" placeholder="••••" />
) }