/** * CanvasNode Component * Renders a workflow node on the canvas with input/output ports */ 'use client'; import React, { MouseEvent } from 'react'; import type { WorkflowNode, NodeType, Position } from './types'; import { getNodeIcon } from './icons'; import styles from '../../scss/atoms/workflow-editor.module.scss'; export interface CanvasNodeProps { node: WorkflowNode; nodeType: NodeType | undefined; isSelected: boolean; onSelect: (id: string) => void; onDoubleClick: (id: string) => void; onDragStart: (e: MouseEvent, nodeId: string) => void; onConnectionStart: (nodeId: string, outputName: string, position: Position) => void; onConnectionEnd: (nodeId: string, inputName: string) => void; isDrawingConnection: boolean; } export function CanvasNode({ node, nodeType, isSelected, onSelect, onDoubleClick, onDragStart, onConnectionStart, onConnectionEnd, isDrawingConnection, }: CanvasNodeProps): React.ReactElement { const color = nodeType?.color || '#666'; return (
{nodeType?.description || 'Custom node'}