Skip to content

Enhanced ChatGPT Clone: Features Agents, MCP, Skills, DeepSeek, Anthropic, AWS, OpenAI, Responses API, Azure, Groq, o1, GPT-5, Mistral, OpenRouter, Vertex AI, Gemini, Artifacts, AI model switching, message search, Code Interpreter, langchain, DALL-E-3, OpenAPI Actions, Functions, Secure Multi-User Auth, Presets, open-source for self-hosting. Active

672 B
Raw Blame
import { createContext, useContext } from 'react';
import type { ReactNode } from 'react';

/** The author a message restates wherever its content resumes after a steer. */
export type TMessageAuthor = {
  icon: ReactNode;
  label: string;
};

/**
 * Carries the message author to the headers inside its content. The author can
 * resolve after the message paints, when an agent's name and avatar arrive with the
 * agents list, and a context change reaches only the headers that read it rather
 * than every part of the message.
 */
export const AuthorContext = createContext<TMessageAuthor | null>(null);
export const useAuthorContext = () => useContext(AuthorContext);