import { Button, Switch, Tooltip } from "antd";
import { BookOpenText, Bot, Clapperboard, Focus, Globe2, LayoutTemplate, Laptop, PanelRightClose, PanelsTopLeft, RotateCcw, Workflow } from "lucide-react";
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,
}: {
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;
}) {
return (
);
}
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 }) => (
))}
);
}