MCPcopy
hub / github.com/opentrace/opentrace / NodeDetailsPanel

Function NodeDetailsPanel

ui/src/appComponents/NodeDetailsPanel.tsx:181–619  ·  view source on GitHub ↗
({
  node,
  nodeSource,
  sourceLoading,
  sourceError,
  communityName,
  communityColor,
  edges,
  onSelectNode,
  onSelectEdge,
}: NodeDetailsPanelProps)

Source from the content-addressed store, hash-verified

179}
180
181export default function NodeDetailsPanel({
182 node,
183 nodeSource,
184 sourceLoading,
185 sourceError,
186 communityName,
187 communityColor,
188 edges,
189 onSelectNode,
190 onSelectEdge,
191}: NodeDetailsPanelProps) {
192 const [previewTab, setPreviewTab] = useState<PreviewTab>('rendered');
193 const color = getNodeColor(node.type);
194 const isLight = document.documentElement.dataset.mode === 'light';
195 const prismTheme = isLight ? themes.oneLight : themes.oneDark;
196
197 const hasEnrichment = !!(
198 node.properties?.summary || node.properties?.has_embedding
199 );
200 const sourceUri = node.properties?.sourceUri as string | undefined;
201 const sourceName = (
202 node.properties?.source_name as string | undefined
203 )?.toLowerCase();
204 const ProviderIcon = sourceName ? PROVIDER_ICONS[sourceName] : undefined;
205
206 return (
207 <div className="node-details-content">
208 {/* ── Header: [type] name … [View on] ── */}
209 <div className="detail-header">
210 <span className="type-badge" style={{ backgroundColor: color }}>
211 {node.type}
212 </span>
213 {communityName && (
214 <span
215 className="type-badge community-badge"
216 style={{
217 color: communityColor ?? '#64748b',
218 border: `1.5px solid ${communityColor ?? '#64748b'}`,
219 }}
220 >
221 {communityName}
222 </span>
223 )}
224 <span className="detail-name">{node.name || 'N/A'}</span>
225 {sourceUri && (
226 <a
227 className="source-link"
228 href={sourceUri}
229 target="_blank"
230 rel="noopener noreferrer"
231 >
232 {ProviderIcon ? (
233 <ProviderIcon />
234 ) : (
235 <svg
236 width="16"
237 height="16"
238 viewBox="0 0 24 24"

Callers

nothing calls this directly

Calls 4

getNodeColorFunction · 0.85
decodeSvgContentFunction · 0.85
getLinkColorFunction · 0.85
detectLanguageFunction · 0.70

Tested by

no test coverage detected