'use client'; import * as React from 'react'; import { cn } from '../../lib/utils'; import { StatusBadge } from '../badge/StatusBadge'; import { EmptyState } from '../states/EmptyState'; import type { NodeExecView } from './types'; import { NODE_STATUS_BADGE, formatDuration } from './exec-status'; export interface ExecNodeDetailsProps { /** The selected node execution, or null when nothing is selected. */ node: NodeExecView | null | undefined; className?: string; } function JsonBlock({ label, value, }: { label: string; value: Record | null | undefined; }) { const isEmpty = value == null || Object.keys(value).length === 0; return (

{label}

{isEmpty ? (

No {label.toLowerCase()}.

) : (
          {JSON.stringify(value, null, 2)}
        
)}
); } /** * Read-only detail panel for a single node execution: name, type, status * badge, duration, error, and pretty-printed input/output JSON. Purpose-built * for the execution monitor — deliberately NOT the editor's NodeInspector. */ export function ExecNodeDetails({ node, className }: ExecNodeDetailsProps) { if (!node) { return ( ); } const duration = formatDuration(node.executionTimeMs); return (

{node.name ?? node.nodeId}

{node.type && {node.type}} {duration && {duration}}
{node.status === 'error' && node.error && (

{node.error}

)}
); }