import { FormEvent, useState } from 'react' import { KeyRound } from 'lucide-react' export type PasswordOptions = { title?: string message?: string confirmText?: string } export function PasswordDialog({ options, onClose, }: { options: PasswordOptions onClose: (value: string | null) => void }) { const [password, setPassword] = useState('') const onSubmit = (event: FormEvent) => { event.preventDefault() if (!password) return onClose(password) } return (
onClose(null)} >
event.stopPropagation()} >

{options.title || '需要密码确认'}

{options.message || '请输入当前账号密码以继续。'}

setPassword(event.target.value)} className="mt-4 w-full rounded-2xl border border-gray-200 bg-gray-50 px-4 py-3 text-ink-600 outline-none transition focus:border-brand-500 focus:bg-white focus:ring-4 focus:ring-brand-100/40" placeholder="当前账号密码" autoComplete="current-password" />
) }