"use client"; import { useState } from "react"; import { Braces, ChevronRight, CircleOff, Copy, GitFork, X } from "lucide-react"; import { FieldTree } from "@/components/FieldTree"; import type { FlowEdgeRecord, FlowNodeRecord, RunGraph } from "@/lib/types"; type Tab = "fields" | "lineage" | "contract"; function EdgeList({ title, edges, graph, direction }: { title: string; edges: FlowEdgeRecord[]; graph: RunGraph; direction: "incoming" | "outgoing"; }) { return

{title}{edges.length}

{edges.length ?
{edges.map((edge) => { const otherId = direction === "incoming" ? edge.source : edge.target; const other = graph.nodes.find((item) => item.id === otherId); return
{other?.title ?? otherId}{edge.label ?? edge.kind}
; })}
:

无连接

}
; } export function Inspector({ item, graph, onClose }: { item: FlowNodeRecord; graph: RunGraph; onClose: () => void; }) { const [tab, setTab] = useState("fields"); const incoming = graph.edges.filter((edge) => edge.target === item.id); const outgoing = graph.edges.filter((edge) => edge.source === item.id); const expectedFields = graph.schema_catalog[item.record.model_name] ?? []; const copyJson = () => navigator.clipboard?.writeText(JSON.stringify(item.record.payload, null, 2)); return ; }