import { Eye, EyeOff } from "lucide-react" import { useState } from "react" import { Button } from "@/components/ui/button" import { Dialog, DialogContent, DialogHeader, DialogTitle, } from "@/components/ui/dialog" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" interface EditInfoDialogProps { open: boolean onOpenChange: (open: boolean) => void initialData?: { username: string taobao: string password: string email: string wechat: string qq: string } onSave?: (data: any) => void } export function EditInfoDialog({ open, onOpenChange, initialData = { username: "191****1234", taobao: "191****1234", password: "********", email: "123456123@qq.com", wechat: "", qq: "", }, onSave, }: EditInfoDialogProps) { const [formData, setFormData] = useState(initialData) const [showPassword, setShowPassword] = useState(false) const handleChange = (field: string, value: string) => { setFormData(prev => ({ ...prev, [field]: value })) } const handleSubmit = () => { onSave?.(formData) onOpenChange(false) } return ( 编辑信息
{/* 用户名 */}
handleChange("username", e.target.value)} className="h-11 bg-gray-50 border-gray-200" />
{/* 淘宝会员名 */}
handleChange("taobao", e.target.value)} className="h-11 bg-gray-50 border-gray-200" />
{/* 密码 */}
handleChange("password", e.target.value)} className="h-11 bg-gray-50 border-gray-200 pr-10" />
{/* 邮箱 */}
handleChange("email", e.target.value)} className="h-11 bg-gray-50 border-gray-200" />
{/* 微信 */}
handleChange("wechat", e.target.value)} placeholder="请输入" className="h-11 bg-gray-50 border-gray-200" />
{/* QQ */}
handleChange("qq", e.target.value)} placeholder="请输入" className="h-11 bg-gray-50 border-gray-200" />
{/* 保存按钮 */}
) }