Compare commits

..

3 Commits

View File

@@ -41,6 +41,7 @@ const ToolsTab = ({
}) => { }) => {
const [params, setParams] = useState<Record<string, unknown>>({}); const [params, setParams] = useState<Record<string, unknown>>({});
const [isToolRunning, setIsToolRunning] = useState(false); const [isToolRunning, setIsToolRunning] = useState(false);
const [filterText, setFilterText] = useState("");
useEffect(() => { useEffect(() => {
const params = Object.entries( const params = Object.entries(
@@ -52,6 +53,12 @@ const ToolsTab = ({
setParams(Object.fromEntries(params)); setParams(Object.fromEntries(params));
}, [selectedTool]); }, [selectedTool]);
const filteredTools = filterText
? tools.filter((tool) =>
tool.name.toLowerCase().includes(filterText.toLowerCase())
)
: tools;
const renderToolResult = () => { const renderToolResult = () => {
if (!toolResult) return null; if (!toolResult) return null;
@@ -124,8 +131,15 @@ const ToolsTab = ({
return ( return (
<TabsContent value="tools"> <TabsContent value="tools">
<div className="grid grid-cols-2 gap-4"> <div className="grid grid-cols-2 gap-4">
<div className="space-y-2">
<Input
placeholder="Filter tools by name..."
value={filterText}
onChange={(e) => setFilterText(e.target.value)}
className="w-full"
/>
<ListPane <ListPane
items={tools} items={filteredTools}
listItems={listTools} listItems={listTools}
clearItems={() => { clearItems={() => {
clearTools(); clearTools();
@@ -144,7 +158,7 @@ const ToolsTab = ({
buttonText={nextCursor ? "List More Tools" : "List Tools"} buttonText={nextCursor ? "List More Tools" : "List Tools"}
isButtonDisabled={!nextCursor && tools.length > 0} isButtonDisabled={!nextCursor && tools.length > 0}
/> />
</div>
<div className="bg-card rounded-lg shadow"> <div className="bg-card rounded-lg shadow">
<div className="p-4 border-b border-gray-200 dark:border-gray-800"> <div className="p-4 border-b border-gray-200 dark:border-gray-800">
<h3 className="font-semibold"> <h3 className="font-semibold">