/** * 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/workflowAutomationApi'; import { useLanguage } from '../../../providers/language/LanguageContext'; import { getCategoryIcon } from '../nodes/shared/utils'; import type { GetLabelFn } from '../nodes/shared/utils'; import styles from './WorkflowFlowEditor.module.css'; import { AiBadge } from '../nodes/shared/AiBadge'; interface NodeListItemProps { node: NodeType; language: string; getLabel: GetLabelFn; getCategoryIcon?: (categoryId: string) => React.ReactNode; } export const NodeListItem: React.FC = ({ node, language, getLabel, getCategoryIcon: getIcon = getCategoryIcon, }) => { const { t } = useLanguage(); const desc = getLabel(node.description, language); return (
{ e.dataTransfer.setData('application/json', JSON.stringify({ type: node.id })); e.dataTransfer.effectAllowed = 'copy'; }} >
{getIcon(node.category)}
{getLabel(node.label, language)} {node.meta?.usesAi === true && ( )} {desc}
{desc &&
{desc}
}
); };