1 import React from "react";
2 import PropTypes from "prop-types";
11 const handleChange = (event) => {
12 const target = event.target;
13 const value = target.value;
14 onTermChange(index, value);
17 const handleAddTerm = (event) => {
21 const handleRemoveTerm = (event) => {
26 <div key={index} className="search-term">
27 <input type="text" value={value} onChange={handleChange}/>
28 <button onClick={handleRemoveTerm}>Remove</button>
33 SearchTerm.propTypes = {
34 index: PropTypes.number.isRequired,
35 value: PropTypes.string.isRequired,
36 onTermChange: PropTypes.func.isRequired,
37 onAddTerm: PropTypes.func.isRequired,
38 onRemoveTerm: PropTypes.func.isRequired,
41 export default SearchTerm;