style: optimize mcp arg name display layout when tool or prompt descr… (#5467)

* style: optimize mcp arg name display layout when tool or prompt description is short

* style: optimize mcp arg name display layout, make it simple

* fix: remove unused import
This commit is contained in:
Akey Zhang 2025-04-30 11:22:39 +08:00 committed by GitHub
parent 37f09d3cb8
commit c8240421e9
2 changed files with 5 additions and 5 deletions

View File

@ -1,5 +1,5 @@
import { MCPPrompt } from '@renderer/types'
import { Collapse, Descriptions, Empty, Flex, Tag, Tooltip, Typography } from 'antd'
import { Collapse, Descriptions, Empty, Flex, Tooltip, Typography } from 'antd'
import { useTranslation } from 'react-i18next'
import styled from 'styled-components'
@ -22,11 +22,11 @@ const MCPPromptsSection = ({ prompts }: MCPPromptsSectionProps) => {
<Descriptions.Item
key={index}
label={
<Flex vertical gap={4}>
<Flex gap={4}>
<Typography.Text strong>{arg.name}</Typography.Text>
{arg.required && (
<Tooltip title="Required field">
<Tag color="red">Required</Tag>
<span style={{ color: '#f5222d' }}>*</span>
</Tooltip>
)}
</Flex>

View File

@ -51,11 +51,11 @@ const MCPToolsSection = ({ tools, server, onToggleTool }: MCPToolsSectionProps)
<Descriptions.Item
key={key}
label={
<Flex vertical gap={4}>
<Flex gap={4}>
<Typography.Text strong>{key}</Typography.Text>
{tool.inputSchema.required?.includes(key) && (
<Tooltip title="Required field">
<Tag color="red">Required</Tag>
<span style={{ color: '#f5222d' }}>*</span>
</Tooltip>
)}
</Flex>