feat: add project-aware agent workspace
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { Droplet } from "lucide-react";
|
||||
import { StartupScreen } from "@/shared/ui/startup-screen";
|
||||
|
||||
export type ProjectStartupState = { phase: "projects" } | { phase: "context"; projectName: string };
|
||||
|
||||
export function ProjectStartupScreen({ state, error, onRetry }: {
|
||||
state: ProjectStartupState;
|
||||
error: string | null;
|
||||
onRetry: () => void;
|
||||
}) {
|
||||
const readingProjects = state.phase === "projects";
|
||||
|
||||
return (
|
||||
<StartupScreen
|
||||
brand={{ name: "TJWater", description: "智慧水务平台", icon: <Droplet strokeWidth={1.5} /> }}
|
||||
title={error ? "暂时无法进入工作台" : readingProjects ? "正在加载授权项目" : "正在准备项目环境"}
|
||||
description={error ? "请查看原因后重试。" : "正在准备你的项目工作台,完成后自动进入。"}
|
||||
progressLabel="项目加载进度"
|
||||
steps={[
|
||||
{ id: "projects", label: "读取授权项目", state: readingProjects ? "loading" : "complete",
|
||||
detail: readingProjects ? "获取当前账号可访问的项目列表" : "已获取可访问的项目" },
|
||||
{ id: "context", label: "准备项目环境", state: readingProjects ? "waiting" : "loading",
|
||||
detail: state.phase === "context" ? `${state.projectName}\n正在读取项目配置与访问权限` : "等待项目列表返回" }
|
||||
]}
|
||||
error={error}
|
||||
onRetry={onRetry}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user