mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
refactor stuff into the MCP dir
This commit is contained in:
parent
389ab1db77
commit
2717bdc36a
4 changed files with 5 additions and 8 deletions
|
|
@ -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={() => {
|
||||
|
|
|
|||
|
|
@ -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 = {
|
||||
|
|
@ -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';
|
||||
|
|
|
|||
|
|
@ -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 (
|
||||
Loading…
Add table
Add a link
Reference in a new issue