refactor: use shadcn sidebar

This commit is contained in:
tao.chen
2026-08-25 20:20:14 +08:00
parent 9294c7fd9f
commit e186e5e541
10 changed files with 245 additions and 205 deletions
+23
View File
@@ -0,0 +1,23 @@
import { useAuth } from "~/context/AuthContext";
import { useScriptWorkspaceStore } from "~/features/platform/state/scriptWorkspaceStore";
import { useUiStore } from "~/features/platform/state/uiStore";
import { ProjectManagementPage } from "~/features/admin/ProjectManagementPage";
/**
* /system/projects 路由页。ProjectManagementPage 内部有 useState
* 在 user / workspace 切换时必须重挂载以重置本地状态
* (见 CLAUDE.md「Route components with their own internal state」)。
*/
export default function ProjectManagementRoute() {
const { user, currentWorkspace } = useAuth();
const setApiOnline = useScriptWorkspaceStore((s) => s.setApiOnline);
const pushToast = useUiStore((s) => s.pushToast);
return (
<ProjectManagementPage
key={`${user?.user_id ?? "anon"}-${currentWorkspace?.workspace_id ?? "none"}`}
onNotify={pushToast}
onConnectionChange={setApiOnline}
/>
);
}