mirror of
https://github.com/BerriAI/litellm.git
synced 2025-04-26 11:14:04 +00:00
fix linting on DataTableWrapper
This commit is contained in:
parent
0e321eed1a
commit
eb4b8d9e7d
1 changed files with 28 additions and 3 deletions
|
@ -5,6 +5,31 @@ import { columns, ToolTestPanel } from './columns';
|
||||||
import { MCPTool, MCPToolsViewerProps, CallMCPToolResponse } from './types';
|
import { MCPTool, MCPToolsViewerProps, CallMCPToolResponse } from './types';
|
||||||
import { listMCPTools, callMCPTool } from '../networking';
|
import { listMCPTools, callMCPTool } from '../networking';
|
||||||
|
|
||||||
|
// Wrapper to handle the type mismatch between MCPTool and DataTable's expected type
|
||||||
|
function DataTableWrapper({
|
||||||
|
columns,
|
||||||
|
data,
|
||||||
|
isLoading,
|
||||||
|
}: {
|
||||||
|
columns: any;
|
||||||
|
data: MCPTool[];
|
||||||
|
isLoading: boolean;
|
||||||
|
}) {
|
||||||
|
// Create a dummy renderSubComponent and getRowCanExpand function
|
||||||
|
const renderSubComponent = () => <div />;
|
||||||
|
const getRowCanExpand = () => false;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<DataTable
|
||||||
|
columns={columns as any}
|
||||||
|
data={data as any}
|
||||||
|
isLoading={isLoading}
|
||||||
|
renderSubComponent={renderSubComponent}
|
||||||
|
getRowCanExpand={getRowCanExpand}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
export default function MCPToolsViewer({
|
export default function MCPToolsViewer({
|
||||||
accessToken,
|
accessToken,
|
||||||
userRole,
|
userRole,
|
||||||
|
@ -49,7 +74,7 @@ export default function MCPToolsViewer({
|
||||||
const toolsData = React.useMemo(() => {
|
const toolsData = React.useMemo(() => {
|
||||||
if (!mcpTools) return [];
|
if (!mcpTools) return [];
|
||||||
|
|
||||||
return mcpTools.map(tool => ({
|
return mcpTools.map((tool: MCPTool) => ({
|
||||||
...tool,
|
...tool,
|
||||||
onToolSelect: (tool: MCPTool) => {
|
onToolSelect: (tool: MCPTool) => {
|
||||||
setSelectedTool(tool);
|
setSelectedTool(tool);
|
||||||
|
@ -61,7 +86,7 @@ export default function MCPToolsViewer({
|
||||||
|
|
||||||
// Filter tools based on search term
|
// Filter tools based on search term
|
||||||
const filteredTools = React.useMemo(() => {
|
const filteredTools = React.useMemo(() => {
|
||||||
return toolsData.filter(tool => {
|
return toolsData.filter((tool: MCPTool) => {
|
||||||
const searchLower = searchTerm.toLowerCase();
|
const searchLower = searchTerm.toLowerCase();
|
||||||
return (
|
return (
|
||||||
tool.name.toLowerCase().includes(searchLower) ||
|
tool.name.toLowerCase().includes(searchLower) ||
|
||||||
|
@ -122,7 +147,7 @@ export default function MCPToolsViewer({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<DataTable
|
<DataTableWrapper
|
||||||
columns={columns}
|
columns={columns}
|
||||||
data={filteredTools}
|
data={filteredTools}
|
||||||
isLoading={isLoadingTools}
|
isLoading={isLoadingTools}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue