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

1.2 KB
Raw Blame
import type { AgentItem } from '../items/types';
import BuiltinSection from './sections/BuiltinSection';
import ActionSection from './sections/ActionSection';
import SkillSection from './sections/SkillSection';
import ToolSection from './sections/ToolSection';
import McpSection from './sections/McpSection';
import { useAgentFileEntries } from '../hooks';

interface Props {
  item: AgentItem;
  agentId: string;
  onClose: () => void;
}

export default function ItemDialogBody({ item, agentId, onClose }: Props) {
  const { contextFiles, knowledgeFiles, codeFiles } = useAgentFileEntries();

  if (item.kind === 'builtin') {
    return (
      <BuiltinSection
        builtinId={item.id}
        agentId={agentId}
        contextFiles={contextFiles}
        knowledgeFiles={knowledgeFiles}
        codeFiles={codeFiles}
        description={item.description}
      />
    );
  }
  if (item.kind === 'tool') {
    return <ToolSection item={item} />;
  }
  if (item.kind === 'skill') {
    return <SkillSection item={item} />;
  }
  if (item.kind === 'mcp') {
    return <McpSection item={item} />;
  }
  return <ActionSection item={item} agentId={agentId} onClose={onClose} />;
}