import { faTags as tagsIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import React from 'react'; import { isEmpty } from 'ramda'; import PropTypes from 'prop-types'; import SearchField from '../utils/SearchField'; import Tag from '../tags/helpers/Tag'; import { shortUrlsListParamsType } from './reducers/shortUrlsListParams'; import './SearchBar.scss'; const propTypes = { listShortUrls: PropTypes.func, shortUrlsListParams: shortUrlsListParamsType, }; const SearchBar = (colorGenerator) => { const SearchBar = ({ listShortUrls, shortUrlsListParams }) => { const selectedTags = shortUrlsListParams.tags || []; return (
listShortUrls({ ...shortUrlsListParams, searchTerm }) } /> {!isEmpty(selectedTags) && (

  {selectedTags.map((tag) => ( listShortUrls( { ...shortUrlsListParams, tags: selectedTags.filter((selectedTag) => selectedTag !== tag), } )} /> ))}

)}
); }; SearchBar.propTypes = propTypes; return SearchBar; }; export default SearchBar;