"use client";

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

export const EmailActionNode = memo(({ data, selected }: NodeProps<any>) => {
  const summary = data.to
    ? `To: ${data.to}`
    : "수신자를 설정해 주세요";

  return (
    <CompactNodeShell
      color="#EC4899"
      label={data.displayName || "메일 발송"}
      summary={summary}
      icon={<Mail className="h-3.5 w-3.5" />}
      selected={selected}
    >
      {data.subject && (
        <div className="line-clamp-2">
          제목: {data.subject}
        </div>
      )}
    </CompactNodeShell>
  );
});

EmailActionNode.displayName = "EmailActionNode";
