const[isCard,setIsCard]=useState(true);// Card view is default
const[sortUp,setSortUp]=useState(true);
const[visibleItems,setVisibleItems]=useState([]);
constsearch=items=>{
const[isCard,setIsCard]=useState(!(hasParameters('search')||hasParameters('q')));// Card view is default when search and query parameters are not present
const[sort,setSort]=useState(hasParameters('search')?'score':'alphabet');// Sorting by relevance score is default when search parameters are present