import React from 'react'; import type { IPipeline } from '../../domain'; import { ValidationMessage } from '../../presentation'; import { SpelText } from '../../widgets'; export interface IMapPair { key: string; value: string; error?: string; } export const MapPair = (props: { keyLabel: string; valueLabel: string; labelsLeft: boolean; pair: IMapPair; onChange: (pair: IMapPair) => void; onDelete: () => void; valueCanContainSpel?: boolean; pipeline?: IPipeline; }) => { const { keyLabel, labelsLeft, pair, onChange, onDelete, valueLabel, valueCanContainSpel, pipeline } = props; return ( <> {labelsLeft && ( {keyLabel} )} onChange({ key: e.target.value, value: pair.value })} /> {labelsLeft && ( {valueLabel} )} {valueCanContainSpel ? ( onChange({ key: pair.key, value: value })} /> ) : ( onChange({ key: pair.key, value: e.target.value })} /> )}
Remove field
{pair.error && ( )} ); };