Pick the most useful property to show inline (skip boring ones)
(props: Record<string, unknown>)
| 27 | |
| 28 | /** Pick the most useful property to show inline (skip boring ones) */ |
| 29 | function pickInlineProp(props: Record<string, unknown>): string | null { |
| 30 | const skip = new Set(['display_name', 'name', 'id', 'type']); |
| 31 | for (const [k, v] of Object.entries(props)) { |
| 32 | if (skip.has(k)) continue; |
| 33 | const s = String(v); |
| 34 | if (s && s !== 'undefined' && s !== 'null') return `${k}: ${s}`; |
| 35 | } |
| 36 | return null; |
| 37 | } |
| 38 | |
| 39 | /** Compact table-like row layout for node lists */ |
| 40 | export default function NodeListResult({ nodes, onNodeSelect }: Props) { |