"use client"; /** * DELETE 액션 노드 */ import { memo } from "react"; import { Handle, Position, NodeProps } from "reactflow"; import { Trash2, AlertTriangle } from "lucide-react"; import type { DeleteActionNodeData } from "@/types/node-editor"; export const DeleteActionNode = memo(({ data, selected }: NodeProps) => { return (
{/* 입력 핸들 */} {/* 헤더 */}
DELETE
{data.displayName || data.targetTable}
{/* 본문 */}
타겟: {data.targetTable}
{/* WHERE 조건 */} {data.whereConditions && data.whereConditions.length > 0 ? (
WHERE 조건:
{data.whereConditions.map((condition, idx) => (
{condition.field} {condition.operator} {condition.sourceField || condition.staticValue || "?"}
))}
) : (
⚠️ 조건 없음 - 모든 데이터 삭제 주의!
)} {/* 경고 메시지 */}
주의
삭제된 데이터는 복구할 수 없습니다
{/* 옵션 */} {data.options?.requireConfirmation && (
실행 전 확인 필요
)}
{/* 출력 핸들 */}
); }); DeleteActionNode.displayName = "DeleteActionNode";