"use client"; import { memo } from "react"; import { NodeProps } from "reactflow"; import { BarChart3 } from "lucide-react"; import { CompactNodeShell } from "./CompactNodeShell"; import type { AggregateNodeData } from "@/types/node-editor"; export const AggregateNode = memo(({ data, selected }: NodeProps) => { const opCount = data.operations?.length || 0; const groupCount = data.groupByFields?.length || 0; const summary = opCount > 0 ? `${opCount}개 연산${groupCount > 0 ? `, ${groupCount}개 그룹` : ""}` : "집계 연산을 설정해 주세요"; return ( } selected={selected} > {opCount > 0 && (
{data.operations!.slice(0, 3).map((op: any, i: number) => (
{op.function || op.operation} {op.field || op.sourceField}
))}
)}
); }); AggregateNode.displayName = "AggregateNode";