import React, { Fragment } from 'react' import isEmpty from 'lodash/isEmpty' import { Input } from 'features/Common' import { ItemsList } from 'features/ItemsList' import { OutsideClick } from 'features/OutsideClick' import { useSearch } from './hooks' import { Header } from './components/Header' import { Wrapper, Form, Results, } from './styled' export const Search = () => { const { close, normalizedItems: { players, teams, tournaments, }, onChange, onFocus, onSubmit, showResults, } = useSearch() return (
{showResults && ( {!isEmpty(tournaments) && (
)} {!isEmpty(teams) && (
)} {!isEmpty(players) && (
)} )} ) }