1 import React from "react";
2 import PropTypes from "prop-types";
3 import {Form, Icon, Button} from "react-bulma-components/full";
4 import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'
5 import {faTrashAlt, faComments} from '@fortawesome/free-solid-svg-icons'
14 const handleChange = (event) => {
15 const target = event.target;
16 const value = target.value;
17 onTermChange(index, value);
20 const handleRemoveTerm = (event) => {
25 <div key={index} className="search-term">
26 <Form.Field kind="addons">
27 <Form.Control iconLeft iconRight>
28 <Form.Input type="text" value={value} onChange={handleChange} placeholder="Enter a term"/>
30 <FontAwesomeIcon icon={faComments}/>
34 <Button onClick={handleRemoveTerm} color="danger" outlined>
36 <FontAwesomeIcon icon={faTrashAlt}/>
45 SearchTerm.propTypes = {
46 index: PropTypes.number.isRequired,
47 value: PropTypes.string.isRequired,
48 onTermChange: PropTypes.func.isRequired,
49 onAddTerm: PropTypes.func.isRequired,
50 onRemoveTerm: PropTypes.func.isRequired,
53 export default SearchTerm;