ui-nyla/src/components/FlowEditor/nodes/loop/LoopNodeConfig.tsx
ValueOn AG 7eb305f910
Some checks failed
Deploy Nyla Frontend to Integration / deploy (push) Failing after 56s
cp adapted to 2026 poweron
2026-06-09 09:53:38 +02:00

28 lines
1 KiB
TypeScript

// Copyright (c) 2026 PowerOn AG
// All rights reserved.
/**
* Loop node config - Datenquelle für Iteration mit benutzerfreundlichen Labels.
* Z.B. für jedes Formularfeld, jede Datei aus Upload, jede E-Mail aus Suche.
*/
import React from 'react';
import type { NodeConfigRendererProps } from '../shared/types';
import { LoopItemsSelect } from '../shared/LoopItemsSelect';
import { createValue, isRef, isValue } from '../shared/dataRef';
import styles from '../../editor/WorkflowFlowEditor.module.css';
export const LoopNodeConfig: React.FC<NodeConfigRendererProps> = ({ params, updateParam }) => {
const value = params.items;
const ref = isRef(value) ? value : null;
const selectValue = ref ?? (isValue(value) ? value : null);
const handleChange = (newRef: { type: 'ref'; nodeId: string; path: (string | number)[] } | null) => {
updateParam('items', newRef ?? createValue([]));
};
return (
<div className={styles.ifElseConditionEditor}>
<LoopItemsSelect value={selectValue} onChange={handleChange} />
</div>
);
};