import { useState } from "react"; import type { AccountCreate } from "@/api/types"; import { useT } from "@/lib/i18n"; interface Props { onSave: (data: AccountCreate) => void; onClose: () => void; } export function AddModal({ onSave, onClose }: Props) { const t = useT(); const [login, setLogin] = useState(""); const [password, setPassword] = useState(""); const [email, setEmail] = useState(""); const [proxy, setProxy] = useState(""); const handleSave = () => { if (!login || !password) return; onSave({ login, password, email: email || undefined, proxy: proxy || undefined, }); }; return (