mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-01 17:39:39 +02:00
Squashed 'ai-context/workbench-ui/' content from commit 32e36a5c
git-subtree-dir: ai-context/workbench-ui git-subtree-split: 32e36a5c2131e429a7081cfaf67dabad3193cda3
This commit is contained in:
commit
a8390532f7
310 changed files with 56430 additions and 0 deletions
32
src/components/agents/ToolsTable.tsx
Normal file
32
src/components/agents/ToolsTable.tsx
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
import { useMemo } from "react";
|
||||
import { getCoreRowModel, useReactTable } from "@tanstack/react-table";
|
||||
|
||||
import { columns, type AgentTool } from "../../model/agent-tools-table";
|
||||
import ClickableTable from "../common/ClickableTable";
|
||||
|
||||
const ToolsTable = ({ setSelected, tools }) => {
|
||||
// Transform the raw tools data to match our table structure
|
||||
const tableData: AgentTool[] = useMemo(() => {
|
||||
return tools.map(([id, config]) => ({
|
||||
id,
|
||||
name: config?.name || "",
|
||||
description: config?.description || "",
|
||||
type: config?.type || "",
|
||||
}));
|
||||
}, [tools]);
|
||||
|
||||
// Initialize React Table with tool data and column configuration
|
||||
const table = useReactTable({
|
||||
data: tableData,
|
||||
columns: columns,
|
||||
getCoreRowModel: getCoreRowModel(),
|
||||
});
|
||||
|
||||
const onSelect = (row) => {
|
||||
setSelected(row.original.id);
|
||||
};
|
||||
|
||||
return <ClickableTable table={table} onClick={onSelect} />;
|
||||
};
|
||||
|
||||
export default ToolsTable;
|
||||
Loading…
Add table
Add a link
Reference in a new issue