import { Button, Switch, Tooltip } from "antd"; import { BookOpenCheck, BookOpenText, Bot, Clapperboard, Focus, Globe2, History, LayoutTemplate, Laptop, PanelRightClose, PanelsTopLeft, Plus, RotateCcw, Workflow } from "lucide-react"; import { useNavigate } from "react-router"; import type { CanvasContextSummary } from "@/lib/canvas/canvas-context-summary"; import type { CanvasTheme } from "@/lib/canvas-theme"; import { useUserStore } from "@/stores/use-user-store"; import type { CanvasAgentMode } from "./canvas-agent-chat-ui"; export function AgentPanelChrome({ theme, mode, context, referenceCount, confirmTools, canUndo, undoCount, onModeChange, onConfirmToolsChange, onUndo, onCollapse, historyCount = 0, historyActive = false, onOpenHistory, onNewChat, newChatDisabled = false, }: { theme: CanvasTheme; mode: CanvasAgentMode; context: CanvasContextSummary; referenceCount: number; confirmTools: boolean; canUndo: boolean; undoCount: number; onModeChange: (mode: CanvasAgentMode) => void; onConfirmToolsChange: (confirm: boolean) => void; onUndo: () => void; onCollapse: () => void; historyCount?: number; historyActive?: boolean; onOpenHistory?: () => void; onNewChat?: () => void; newChatDisabled?: boolean; }) { const navigate = useNavigate(); return (
Agent
画布协作
) : null} {onNewChat ? (
{context.nodeCount} 个节点 {context.selectedCount ? 选中 {context.selectedCount} : 未选择节点} {context.chapterLabel ? {context.chapterLabel}{context.shotLabel ? ` · ${context.shotLabel}` : ""} : null} {referenceCount ? {referenceCount} 个参考 : null}
); } function AgentModeSwitch({ value, theme, onChange }: { value: CanvasAgentMode; theme: CanvasTheme; onChange: (value: CanvasAgentMode) => void }) { return (
{(["online", "local"] as const).map((item) => { const active = value === item; const Icon = item === "online" ? Globe2 : Laptop; return ( ); })}
); } const starterActions = [ { label: "搭建短剧工作流", icon: Clapperboard }, { label: "整理当前画布", icon: LayoutTemplate }, { label: "生成镜头分镜", icon: PanelsTopLeft }, { label: "检查节点连线", icon: Workflow }, ]; export function AgentChatEmptyState({ theme, nodeCount, onSelect }: { theme: CanvasTheme; nodeCount: number; onSelect: (value: string) => void }) { const shortDramaEnabled = useUserStore((state) => state.features.shortDramaEnabled); const visibleStarterActions = shortDramaEnabled ? starterActions : starterActions.filter((item) => item.label !== "搭建短剧工作流"); return (
{nodeCount} 个节点已就绪

从当前画布开始

{visibleStarterActions.map(({ label, icon: Icon }) => ( ))}
); }