refactor stuff into the MCP dir

This commit is contained in:
Dustin Healy 2025-06-26 15:05:11 -07:00
parent 389ab1db77
commit 2717bdc36a
4 changed files with 5 additions and 8 deletions

View file

@ -2,7 +2,7 @@ import { useCallback } from 'react';
import { useLocalize } from '~/hooks';
import { useToastContext } from '~/Providers';
import { useAgentPanelContext } from '~/Providers/AgentPanelContext';
import MCP from '~/components/SidePanel/Builder/MCP';
import { MCPItem } from '~/components/SidePanel/MCP/MCPItem';
import { Panel } from '~/common';
export default function MCPSection() {
@ -30,7 +30,7 @@ export default function MCPSection() {
{mcps
.filter((mcp) => mcp.agent_id === agent_id)
.map((mcp, i) => (
<MCP
<MCPItem
key={i}
mcp={mcp}
onClick={() => {

View file

@ -10,7 +10,6 @@ import {
} from '~/components/ui/Accordion';
import { DropdownPopup } from '~/components/ui';
import { useLocalize } from '~/hooks';
import { cn } from '~/utils';
interface UserInfoPlaceholder {
label: string;
@ -31,14 +30,12 @@ const userInfoPlaceholders: UserInfoPlaceholder[] = [
{ label: 'role', value: '{{LIBRECHAT_USER_ROLE}}', description: 'User role' },
];
export default function MCPAuth() {
export function MCPAuth() {
const localize = useLocalize();
const { register, watch, setValue } = useFormContext();
const [isHeadersMenuOpen, setIsHeadersMenuOpen] = useState(false);
const customHeaders = watch('customHeaders') || [];
const requestTimeout = watch('requestTimeout') || '';
const connectionTimeout = watch('connectionTimeout') || '';
const addCustomHeader = () => {
const newHeader = {

View file

@ -1,7 +1,7 @@
import { useState, useEffect } from 'react';
import { useFormContext, Controller } from 'react-hook-form';
import type { MCP } from 'librechat-data-provider';
import MCPAuth from '~/components/SidePanel/Builder/MCPAuth';
import { MCPAuth } from '~/components/SidePanel/MCP/MCPAuth';
import MCPIcon from '~/components/SidePanel/Agents/MCPIcon';
import { Label, Checkbox } from '~/components/ui';
import useLocalize from '~/hooks/useLocalize';

View file

@ -9,7 +9,7 @@ type MCPProps = {
onClick: () => void;
};
export default function MCP({ mcp, onClick }: MCPProps) {
export function MCPItem({ mcp, onClick }: MCPProps) {
const [isHovering, setIsHovering] = useState(false);
return (