"use client"; import type { ReactNode } from "react"; import { useState } from "react"; import { ModeToggle } from "./mode-toggle"; import { useFrontendTool } from "@copilotkit/react-core/v2"; interface ExampleLayoutProps { chatContent: ReactNode; appContent: ReactNode; } export function ExampleLayout({ chatContent, appContent }: ExampleLayoutProps) { const [mode, setMode] = useState<"chat" | "app">("chat"); useFrontendTool({ name: "enableAppMode", description: "Enable app mode, make sure its open when interacting with todos.", handler: async () => { setMode("app"); }, }); useFrontendTool({ name: "enableChatMode", description: "Enable chat mode", handler: async () => { setMode("chat"); }, }); return (
{/* Chat Content */} {/* State Panel */}
{/* Fill the state panel's own width. The previous `lg:w-[66.666vw]` was viewport-relative, so with a reserved drawer column it overflowed this container (clipped by overflow-hidden) and pushed centered content right of the visible box's center. */}
{appContent}
); }