import { Moon, Sun } from "lucide-react" import { useMemo } from "react" import { CanvasStage } from "@/components/canvas/canvas-stage" import { CompareDialog } from "@/components/canvas/compare-dialog" import { VersionStrip } from "@/components/canvas/version-strip" import { VersionsProvider, type VersionsSource, } from "@/components/canvas/versions-context" import { useDictionary } from "@/hooks/use-dictionary" import type { DrawioSource } from "@/lib/drawio/drawio-config" import { useSettingsStore } from "@/stores/settings-store" import type { ShellConfig } from "./runtime-config" import { setDark } from "./theme" // No versions until the shell reads the server's History (a later step) const NO_VERSIONS: VersionsSource = { versions: [], onCanvasId: null, undoneId: null, isBusy: false, canUndo: false, canRedo: false, restore: () => {}, undo: () => {}, redo: () => {}, } /** * The MCP preview: the web app's canvas without the chat. A slim bar names * the session and the sync state; the versions strip and Compare come from * the shared canvas components. */ export function CanvasShell({ config }: { config: ShellConfig }) { const dict = useDictionary() const isDark = useSettingsStore((s) => s.isDark) const drawioSource = useMemo( () => ({ editorUrl: config.drawioBaseUrl, ui: config.drawioUi || undefined, lang: config.drawioLang || undefined, }), [config], ) return (
Next AI Draw.io {config.sessionId && ( {config.sessionId.slice(-8)} )} {dict.shell.waiting}
) }