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:
elpresidank 2026-04-05 21:08:02 -05:00
commit a8390532f7
310 changed files with 56430 additions and 0 deletions

View 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;