Compare commits
3 Commits
move_custo
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 306c2ea2e5 | |||
| 633708d0b5 | |||
| 9a307f5d16 |
@@ -41,6 +41,7 @@ const ToolsTab = ({
|
||||
}) => {
|
||||
const [params, setParams] = useState<Record<string, unknown>>({});
|
||||
const [isToolRunning, setIsToolRunning] = useState(false);
|
||||
const [filterText, setFilterText] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
const params = Object.entries(
|
||||
@@ -52,6 +53,12 @@ const ToolsTab = ({
|
||||
setParams(Object.fromEntries(params));
|
||||
}, [selectedTool]);
|
||||
|
||||
const filteredTools = filterText
|
||||
? tools.filter((tool) =>
|
||||
tool.name.toLowerCase().includes(filterText.toLowerCase())
|
||||
)
|
||||
: tools;
|
||||
|
||||
const renderToolResult = () => {
|
||||
if (!toolResult) return null;
|
||||
|
||||
@@ -124,8 +131,15 @@ const ToolsTab = ({
|
||||
return (
|
||||
<TabsContent value="tools">
|
||||
<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
|
||||
items={tools}
|
||||
items={filteredTools}
|
||||
listItems={listTools}
|
||||
clearItems={() => {
|
||||
clearTools();
|
||||
@@ -144,7 +158,7 @@ const ToolsTab = ({
|
||||
buttonText={nextCursor ? "List More Tools" : "List Tools"}
|
||||
isButtonDisabled={!nextCursor && tools.length > 0}
|
||||
/>
|
||||
|
||||
</div>
|
||||
<div className="bg-card rounded-lg shadow">
|
||||
<div className="p-4 border-b border-gray-200 dark:border-gray-800">
|
||||
<h3 className="font-semibold">
|
||||
|
||||
Reference in New Issue
Block a user