* CustomTree is a recursive tree view component for rendering a hierarchy of nodes. * * This component is highly customizable and highlights the selected node. * It supports displaying additional metrics like latency, cost, and token usage. * * Example usage: * ```tsx * <CustomTree * data=
| 25 | * ``` |
| 26 | */ |
| 27 | interface TreeProps { |
| 28 | /** |
| 29 | * Root node of the hierarchical data structure. |
| 30 | */ |
| 31 | data: _AgentaRootsResponse |
| 32 | |
| 33 | /** |
| 34 | * Settings for what additional metrics to show in each node. |
| 35 | */ |
| 36 | settings: { |
| 37 | latency: boolean |
| 38 | cost: boolean |
| 39 | tokens: boolean |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * The currently selected node key (ID). |
| 44 | */ |
| 45 | selectedKey: string | null |
| 46 | |
| 47 | /** |
| 48 | * Function to handle when a node is selected. |
| 49 | */ |
| 50 | onSelect: (key: string) => void |
| 51 | } |
| 52 | |
| 53 | const TreeNodeComponent: React.FC<{ |
| 54 | node: _AgentaRootsResponse |
nothing calls this directly
no outgoing calls
no test coverage detected