({
children,
showToolbar = true,
onDelete,
onSettings,
name,
description,
}: WorkflowNodeProps)
| 15 | }; |
| 16 | |
| 17 | export function WorkflowNode({ |
| 18 | children, |
| 19 | showToolbar = true, |
| 20 | onDelete, |
| 21 | onSettings, |
| 22 | name, |
| 23 | description, |
| 24 | }: WorkflowNodeProps) { |
| 25 | return ( |
| 26 | <> |
| 27 | {showToolbar && ( |
| 28 | <NodeToolbar> |
| 29 | <Button size="sm" variant="ghost" onClick={onSettings}> |
| 30 | <SettingsIcon className="size-4" /> |
| 31 | </Button> |
| 32 | <Button size="sm" variant="ghost" onClick={onDelete}> |
| 33 | <TrashIcon className="size-4" /> |
| 34 | </Button> |
| 35 | </NodeToolbar> |
| 36 | )} |
| 37 | {children} |
| 38 | {name && ( |
| 39 | <NodeToolbar |
| 40 | position={Position.Bottom} |
| 41 | isVisible |
| 42 | className="max-w-[200px] text-center" |
| 43 | > |
| 44 | <p className="font-medium"> |
| 45 | {name} |
| 46 | </p> |
| 47 | {description && ( |
| 48 | <p className="text-muted-foreground truncate text-sm"> |
| 49 | {description} |
| 50 | </p> |
| 51 | )} |
| 52 | </NodeToolbar> |
| 53 | )} |
| 54 | </> |
| 55 | ); |
| 56 | }; |
nothing calls this directly
no outgoing calls
no test coverage detected