"use client";

import { memo } from "react";
import { NodeProps } from "reactflow";
import { Calculator } from "lucide-react";
import { CompactNodeShell } from "./CompactNodeShell";

export const FormulaTransformNode = memo(({ data, selected }: NodeProps<any>) => {
  const summary = data.formula
    ? `${data.formula.substring(0, 30)}${data.formula.length > 30 ? "..." : ""}`
    : "수식을 입력해 주세요";

  return (
    <CompactNodeShell
      color="#F97316"
      label={data.displayName || "수식 변환"}
      summary={summary}
      icon={<Calculator className="h-3.5 w-3.5" />}
      selected={selected}
    />
  );
});

FormulaTransformNode.displayName = "FormulaTransformNode";
