import React, { useState, useEffect } from 'react' import { Input, Icon } from 'UI' export default function EventSearch(props) { const { onChange, clearSearch, value, header } = props; const [showSearch, setShowSearch] = useState(false) useEffect(() => { return () => { clearSearch() } }, []) return (
{ showSearch ?
{ setShowSearch(!showSearch); clearSearch() }} className="flex items-center justify-center cursor-pointer absolute right-0" style={{ height: '30px', width: '32px' }} >
: header }
{ !showSearch &&
setShowSearch(!showSearch)} className="border rounded flex items-center justify-center bg-white cursor-pointer" style={{ height: '32px', width: '32px' }} >
}
) }