/** * NodeListItem - Draggable node type item for the sidebar. * Used in both regular categories and I/O sub-groups. */ import React from 'react'; import type { NodeType } from '../../api/automation2Api'; import { getCategoryIcon } from './utils'; import type { GetLabelFn } from './utils'; import styles from './Automation2FlowEditor.module.css'; interface NodeListItemProps { node: NodeType; language: string; getLabel: GetLabelFn; getCategoryIcon?: (categoryId: string) => React.ReactNode; } export const NodeListItem: React.FC = ({ node, language, getLabel, getCategoryIcon: getIcon = getCategoryIcon, }) => (
{ e.dataTransfer.setData('application/json', JSON.stringify({ type: node.id })); e.dataTransfer.effectAllowed = 'copy'; }} >
{getIcon(node.category)}
{getLabel(node.label, language)} {getLabel(node.description, language)}
);