From ea797ac88a3bad169222109fc4a8db16a6b320f0 Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Thu, 21 Aug 2025 15:14:07 +0800 Subject: [PATCH] feat(DraggableList): add listProps support for custom list configurations - Enhanced DraggableList component to accept listProps, allowing for customization of the Ant Design List component. - Updated MCPSettings to utilize the new listProps feature, providing a custom empty state message when no servers are available. --- .../src/components/DraggableList/list.tsx | 5 +++- .../settings/MCPSettings/McpServersList.tsx | 23 ++++++++++++------- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/src/renderer/src/components/DraggableList/list.tsx b/src/renderer/src/components/DraggableList/list.tsx index 3a2cc5b108..4452cee4c9 100644 --- a/src/renderer/src/components/DraggableList/list.tsx +++ b/src/renderer/src/components/DraggableList/list.tsx @@ -9,13 +9,14 @@ import { ResponderProvided } from '@hello-pangea/dnd' import { droppableReorder } from '@renderer/utils' -import { List } from 'antd' +import { List, ListProps } from 'antd' import { FC } from 'react' interface Props { list: T[] style?: React.CSSProperties listStyle?: React.CSSProperties + listProps?: ListProps children: (item: T, index: number) => React.ReactNode onUpdate: (list: T[]) => void onDragStart?: OnDragStartResponder @@ -28,6 +29,7 @@ const DraggableList: FC> = ({ list, style, listStyle, + listProps, droppableProps, onDragStart, onUpdate, @@ -51,6 +53,7 @@ const DraggableList: FC> = ({ {(provided) => (
{ const id = item.id || item diff --git a/src/renderer/src/pages/settings/MCPSettings/McpServersList.tsx b/src/renderer/src/pages/settings/MCPSettings/McpServersList.tsx index 01aa1599a2..b493714785 100644 --- a/src/renderer/src/pages/settings/MCPSettings/McpServersList.tsx +++ b/src/renderer/src/pages/settings/MCPSettings/McpServersList.tsx @@ -210,7 +210,21 @@ const McpServersList: FC = () => { - + + ) + } + }}> {(server: MCPServer) => (
navigate(`/settings/mcp/settings/${encodeURIComponent(server.id)}`)}> {
)}
- {mcpServers.length === 0 && ( - - )}