refactor(MCPSettings): 简化服务器标签的渲染逻辑

This commit is contained in:
icarus 2025-08-18 09:42:19 +08:00
parent 4300d9225d
commit 1dd08909af

View File

@ -67,13 +67,11 @@ const McpServerCard: FC<McpServerCardProps> = ({
<ServerFooter>
<ServerTag color="processing">{getMcpTypeLabel(server.type ?? 'stdio')}</ServerTag>
{server.provider && <ServerTag color="success">{server.provider}</ServerTag>}
{server.tags
?.filter((tag): tag is string => typeof tag === 'string')
.map((tag) => (
<ServerTag key={tag} color="default">
{tag}
</ServerTag>
))}
{server.tags?.map((tag) => (
<ServerTag key={tag} color="default">
{tag}
</ServerTag>
))}
</ServerFooter>
</CardContainer>
)