import React from 'react'; import Input from '../Input'; import Trash from '@/_ui/Icon/solidIcons/Trash'; import { ButtonSolid } from '@/_ui/AppButton/AppButton'; import AddRectangle from '@/_ui/Icon/bulkIcons/AddRectangle'; import '@/_ui/HttpHeaders/sourceEditorStyles.scss'; import InfoIcon from '@assets/images/icons/info.svg'; export default ({ options, addNewKeyValuePair, removeKeyValuePair, keyValuePairValueChanged, workspaceConstants, isDisabled, width, dataCy, }) => { const darkMode = localStorage.getItem('darkMode') === 'true'; return (
{options.length === 0 && (
There are no key value pairs added
)} {options.map((option, index) => (
keyValuePairValueChanged(e.target.value, 0, index)} value={option[0]} workspaceConstants={workspaceConstants} placeholder="Key" autoComplete="off" disabled={isDisabled} style={{ flex: 1, width: '316px', borderTopRightRadius: '0', borderBottomRightRadius: '0', borderRight: 'none', }} /> keyValuePairValueChanged(e.target.value, 1, index)} workspaceConstants={workspaceConstants} disabled={isDisabled} style={{ flex: 2, width: width ? width : '316px', borderTopLeftRadius: '0', borderBottomLeftRadius: '0', borderTopRightRadius: '0', borderBottomRightRadius: '0', }} />
))}
addNewKeyValuePair(options)} style={{ gap: '0px', fontSize: '12px', fontWeight: '500', padding: '0px 9px' }} disabled={isDisabled} >   Add
); };