import PropTypes from 'prop-types'; import React, { Component } from 'react'; import { icons } from 'Helpers/Props'; import IconButton from 'Components/Link/IconButton'; import TextInput from './TextInput'; import styles from './KeyValueListInputItem.css'; class KeyValueListInputItem extends Component { // // Listeners onKeyChange = ({ value: keyValue }) => { const { index, value, onChange } = this.props; onChange(index, { key: keyValue, value }); } onValueChange = ({ value }) => { // TODO: Validate here or validate at a lower level component const { index, keyValue, onChange } = this.props; onChange(index, { key: keyValue, value }); } onRemovePress = () => { const { index, onRemove } = this.props; onRemove(index); } onFocus = () => { this.props.onFocus(); } onBlur = () => { this.props.onBlur(); } // // Render render() { const { keyValue, value, keyPlaceholder, valuePlaceholder, isNew } = this.props; return (