import React, { PureComponent } from 'react'; import QueryField from './QueryField'; class QueryRow extends PureComponent { constructor(props) { super(props); this.state = { query: '', }; } handleChangeQuery = value => { const { index, onChangeQuery } = this.props; this.setState({ query: value }); if (onChangeQuery) { onChangeQuery(value, index); } }; handleClickAddButton = () => { const { index, onAddQueryRow } = this.props; if (onAddQueryRow) { onAddQueryRow(index); } }; handleClickRemoveButton = () => { const { index, onRemoveQueryRow } = this.props; if (onRemoveQueryRow) { onRemoveQueryRow(index); } }; handlePressEnter = () => { const { onExecuteQuery } = this.props; if (onExecuteQuery) { onExecuteQuery(); } }; render() { const { request } = this.props; return (
); } } export default class QueryRows extends PureComponent { render() { const { className = '', queries, ...handlers } = this.props; return (
{queries.map((q, index) => )}
); } }