"use client"; import { memo } from "react"; import { NodeProps } from "reactflow"; import { Plus } from "lucide-react"; import { CompactNodeShell } from "./CompactNodeShell"; import type { InsertActionNodeData } from "@/types/node-editor"; export const InsertActionNode = memo(({ data, selected }: NodeProps) => { const mappingCount = data.fieldMappings?.length || 0; const summary = data.targetTable ? `${data.targetTable} (${mappingCount}개 필드)` : "대상 테이블을 선택해 주세요"; return ( } selected={selected} > {mappingCount > 0 && (
{data.fieldMappings!.slice(0, 3).map((m, i) => (
{m.sourceFieldLabel || m.sourceField || "?"} {m.targetFieldLabel || m.targetField}
))} {mappingCount > 3 && 외 {mappingCount - 3}개}
)}
); }); InsertActionNode.displayName = "InsertActionNode";