'use client'
import { Badge } from '@sim/emcn'
import { ChevronDown, Clipboard, Download, Search } from 'lucide-react'
import { resolveIcon } from '@/components/workflow-preview/block-icons'
type ValueType = 'string' | 'number' | 'boolean' | 'object' | 'array' | 'null'
/** Output value type → emcn Badge color variant. */
const TYPE_VARIANT = {
string: 'green',
number: 'blue',
boolean: 'orange',
array: 'purple',
object: 'gray',
null: 'gray',
} as const
interface OutputNode {
key: string
type?: ValueType
/** Primitive value shown beneath the key when expanded. */
value?: string
/** Nested fields for object/array nodes. */
children?: OutputNode[]
/** Collapse the node (chevron points right, nothing rendered beneath). */
expanded?: boolean
/** Emphasize this row as the one being read by the tag below. */
highlight?: boolean
}
interface LogRow {
name: string
type?: string
color?: string
duration?: string
selected?: boolean
}
interface OutputBundleProps {
/** The block's name (unique within the workflow), e.g. "classify". */
blockName: string
blockType?: string
blockColor?: string
/** Duration shown on the selected log row. */
duration?: string
/** Override the Logs column; defaults to Start + this block (selected). */
logs?: LogRow[]
values: OutputNode[]
}
function TypeBadge({ type }: { type: ValueType }) {
return (