import React from 'react'; import classNames from 'classnames'; export default function Search({ value, onChange, onClose, open = false, onSubmit = () => {} }) { const closable = typeof onClose === 'function'; const handleSubmit = (e) => { e.preventDefault(); onSubmit(); }; const handleClose = (e) => { e.preventDefault(); onClose(); } return (
{ onChange(e.target.value); }} className="search__field" placeholder="What are you looking for?" /> { closable && ( ) }
); }