import { Modal } from "antd"; import { KeyRound, SlidersHorizontal } from "lucide-react"; import { useState } from "react"; import AccountSettings from "./account_settings"; import GeneralSettings from "./general_settings"; /** 左侧菜单项定义 */ const menuItems = [ { key: "account", label: "账户设置", icon: KeyRound }, { key: "general", label: "基本设置", icon: SlidersHorizontal }, ] as const; type MenuKey = (typeof menuItems)[number]["key"]; /** * 全局设置弹窗 * 为什么用 Modal 而非路由页面:设置是低频操作,弹窗避免离开当前上下文, * 且与 ZLM 节点就地编辑的交互范式一致。 */ export default function SettingsModal({ open, onClose, }: { open: boolean; onClose: () => void; }) { const [activeKey, setActiveKey] = useState("account"); return (
{/* 左侧菜单 */} {/* 右侧内容 */}
{activeKey === "account" && } {activeKey === "general" && }
); }