import { createContext, useContext, type ReactNode } from "react"; import type { NanobotClient } from "@/lib/nanobot-client"; interface ClientContextValue { client: NanobotClient; token: string; modelName: string | null; } const ClientContext = createContext(null); export function ClientProvider({ client, token, modelName = null, children, }: { client: NanobotClient; token: string; modelName?: string | null; children: ReactNode; }) { return ( {children} ); } export function useClient(): ClientContextValue { const ctx = useContext(ClientContext); if (!ctx) { throw new Error("useClient must be used within a ClientProvider"); } return ctx; }